To create a DMG (Disk Image) file begin by opening the APPLICATIONS folder and then launch the AUTOMATOR application by double clicking on its application icon. Automator is an application that enables you to run (execute/launch) certain tasks (macros) from a 'list of scripts'; a cross between a Windows DOS batch file and Office Macros (recorded tasks). Ignore the technicals if you want! All you need to know here is that you will be setting up (using) a script that allows you to perform the task of creating a DMG file.
Fig 1.0 Double click on the AUTOMATOR application icon to continue
After double clicking on the AUTOMATOR application icon the Automator window will open whereby you then need to select a template. With Microsoft Office templates you would select the type of document to work with, such as a Letter, Brochure, Calendar, Label or CV. With Automator you can choice to work with a Workflow, Application, Service, Print Plugin, Folder Action, Calendar Alarm or Image Capture Plugin template. Again, ignore the technicals. In this example because you will be working with a Workflow, which is already selected by default, all you need to do here is click on the CHOOSE button (Fig 1.1 below). Doing so will create a brand new, blank/empty, workflow template (document/file) called Unknown.workflow ready for you to customize with Actions (predefined scripts) (Fig 1.2).
Fig 1.1 Make sure the WORKFLOW Template is selected and then click on the CHOOSE button to continue
With the brand new, blank/empty, workflow template (document/file) called Unknown.workflow now created, the next step is to insert one or more actions (predefined scripts) into it. On the left-side of the Automator window you will see a LIBRARY of categorized actions (predefined scripts). For this example you need to click on the category called FILES & FOLDERS, which will then show you the actions (predefined scripts) you can use, and then drag the NEW DISK IMAGE action (predefined script) across to the window pane on the right-side of the Automator window. When you release the left mouse button, with the NEW DISK IMAGE action (predefined script) hovering over the right-side window pane, a new window/panel will be created for that specific, NEW DISK IMAGE, action (Fig 1.3).
Fig 1.2 Select the FILES & FOLDERS category and drag the NEW DISK IMAGE action (script) over to the right window
When a new window/panel is created for a specific action (predefined script) you may find some of the script's attributes (settings/options) are blank/empty whilst others are automatically filled in with default values. This is quite normal and actually quite helpful because if you're not familiar with every single attribute it can mean some of the more complex attributes have already been filled in for you. In this example the attributes are quite self-explanatory and only need minor additions/adjustments.
Fig 1.3 Releasing the LMB produces a new window/panel for the NEW DISK IMAGE action (predefined script)
The first attribute is the VOLUME NAME (above), which is the name of the Logical Hard Drive created for the DMG file - Whenever you share a DMG file for example, the person receiving it will not see this logical hard drive and therefore its contents until they open (double click on) the DMG file. So the DMG file is like a ZIP file. Until you double click on a ZIP file you will not see its contents displayed inside the new folder created for it. And the same is true of a DMG file. Its contents is not viewable until a logical hard drive has been mounted for it whereby you can then see the contents of the DMG file inside that logical hard drive.
Once you have filled in the VOLUME NAME attribute with your chosen name for the logical hard drive you then need to specify how much space you want allocated for the DMG file. In other words, what size should the logical hard drive be? The default size (below) is 40 MB but in this example I have clicked on the SIZE drop-down menu to select a size of 500 MB.
Fig 1.4 Click on the SIZE drop-down menu and select a size for the DMG file and therefore Logical Hard Drive
The third attribute you need to fill in is the SAVE AS filename attribute. This will be the filename given to the actual DMG file, with the filename extension of .dmg automatically added (suffixed) to the end of it. So in this example although I have entered CWCS_Files into the SAVE AS edit box the full filename (filename + filename extension) for the DMG file, once it has been created, will be CWCS_Files.dmg.
The only other attribute you might want to change is the IN attribute, which states the folder you want to save the DMG file INside. It is set to the DESKTOP by default but if you want to save the DMG file INside another folder simply click on the IN drop-down menu, select the OTHER menu-item and then navigate the CHOOSE folder requester to another folder. In this example I will stick with DESKTOP.
Fig 1.5 Click inside the SAVE AS edit box and enter a filename for the DMG file - .dmg will automatically be suffixed
With the four main attributes for this particular, NEW DISK IMAGE, action (predefined script) filled in the next step is to click on the RUN button, located in the top-right corner of the Automator window, to actually run (execute) the NEW DISK IMAGE action (predefined script). This basically means the set of commands/instructions needed to create the DMG file and mount its associated logical hard drive will be performed, behind the scenes. The attributes you filled in will aid that process in terms of telling OS X (Mountain Lion) where to mount the logical hard drive and so on. Yet again, ignore the technicals. All you need to know here is that a DMG file and a logical hard drive will be created when you click on the RUN button (above).
Fig 1.6 A DMG file called CWCS_Files.dmg has been created along with a Logical Hard Drive called ClickWiseCS
At this point you can close the Automator window by clicking on its standard red eXit (close) button, located in its top-left corner. Doing so will bring up a file requester asking you if you want to save the document (template) called Untitled.workflow, which also now contains the NEW DISK IMAGE action (predefined script) together with your amended attribute values (settings) inside it. In this example I am clicking on the DON'T SAVE button simply because I have no need to reuse this action. If I wanted to create another DMG file I would simply follow the above process again, which doesn't take that long to perform.
Fig 1.7 The execution of the NEW DISK IMAGE action was successful - Now close the Automator window.
Fig 1.8 Want to save the edited, reusable, Untitled.workflow document (template with NEW DISK IMAGE action)?
Now that Automator is out of the way, in this example you are now left with a new DMG file called CWCS_Files.dmg on the desktop together with a new Logical Hard Drive called ClickWiseCS. If you were to EJECT (dismount) the logical hard drive, as shown in Fig 1.6 above, you would be left with the DMG file only whose sole purpose of existence is to mount its associated logical hard drive. In other words, you cannot move (paste or drop) files directly into/over the DMG file. You must mount the logical hard drive first, by double click on the DMG file, and then move (paste or drop) files into/over the newly mounted logical hard drive.
Fig 1.9 You can only move (paste or drop) files into/over the mounted ClickWiseCS logical hard drive
Fig 1.10 A file called Accounts2013_2014.xlsx has been pasted into the mounted ClickWiseCS logical hard drive
As you can see; once you have created a DMG file its mounted logical hard drive acts like a ZIP file (folder) or flash drive. When you have finished moving files into the logical hard drive and then EJECTed it you can then copy the DMG file itself onto an external hard drive or burn it onto a cd/dvd for example and treat it just like a ZIP file. In other words, you could give a copy of the DMG file to a friend who could then double click on it to remount its logical hard drive and therefore see the contents. They could even add more content and then send you an updated version of the DMG file.