|
|
An AppleScript to mount, run, unmount a disk image
I tried to get the AppleScript working. I could get the disk image to mount and the application to start but after the application quit the disk image was still mounted.
I came up with a different solution that works pretty well for my needs. What I wanted was a way to avoid having my children handle CDs and launching applications. To solve this problem I built bootstrap AppleScript application icon and name set to be the same as the program that it ultimately launches. The AppleScript application calls a the mntrun shell script that adds canned, location-specific text to the application and disk image names then mntrun calls the script that does the real work, mntlauncher. Mntlauncher mounts the disk drive image, starts the application, waits for the application to finish, then unmounts the disk image.
Here's the AppleScript that launches "Reader Rabbit's Toddler":
Here's the text of /Applications/Launchers/mntrun:
Here's the text of /Applications/Launchers/mntlaunch:
In mntrun you can see the script is designed for applications to be located in the /Applications folder. The AppleScript application merely needs to make reference to the application path relative to /Applications. In mntrun you can also see that I keep my disk images in /Volumes/160GB HD/CD Cache/Educational/originals, so mntrun creates the proper full path name to the disk image for mntlaunch.
If the user wishes to run an application on the mount volume one merely needs to refer to an application path such as "../Volumes/Volume Name/Application Path". The "../Volumes/Volume Name" is the path to the mounted volume and "Application Path" is the path to the application within the mounted volume.
It's all quite a hack, but at least I can stop having to make CD copies for my children (3 and 6 years old)!
|
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.09 seconds |
|