On Feb 28, 2013, at 10:15 AM, Robert Poland wrote: I'm trying to create a script that will close a disk image if it exists.
I just looked at some old scripting that I used some time ago. Most of it would just confuse the issue, but I did notice my use of 'hdiutil' and I think your problem is easily solvable.
First, read the man page for 'hdiutil'. Second, with one image disk mounted, run this ...
do shell script "hdiutil info -plist"
The result will appear in the console as xml (because of -plist).
Do not even think of digging data out of xml text. Write the data to a .plist file and open it with Xcode to see the structure of the file. Once you understand the structure you can get what you need directly from the data via System Events commands.
There's more to say about this, but I need to look at more scripts. I will continue later.
|