Running a script at login to make a ramdisk

Hi guys, I’m a complete and utter noob to OSX scripts. I am familiar with OSX from using it many years at a design job. Now that I personally own a mac I am trying to pry back the facade and make things jump at my command a bit better.

I have created an unix executable that will create a ram disk. I did this by:

  1. creating a text file called RamDisk with “diskutil erasevolume HFS+ “RamDisk” hdiutil attach -nomount ram://12582912
  2. opening terminal typing “chmod +x RamDisk”

I now have an executable Unix file which I can double click to mount a ram disk.

However, my problem is I’m not sure how to get this to launch at startup. I tried making a startup hook that referenced the file. I tried putting the file into login items. Doesn’t seem to work. I can manually execute the file and it works. So, what do I do? Thanks in advance.

I’ve found a solution (kind of). I’ve made the script into an application that runs at login.

Just to frustrate myself some more though I’ve taken up the challenge of figuring out how get the disk to mount when I launch Photoshop and eject when I quit photoshop. I tried using automator but that requires keyboard input to launch the process of mounting and ejecting. Any idea on how to achieve hands off mounting and ejecting based on whether photoshop is running or not? Thanks.


welcome to MacScripter.

This forum is actually for the deprecated AppleScript Studio environment,
you should post questions about OS X into the OS X forum.

AppleScript isn’t able to respond to launch application notifications,
a workaround is use a script launch and quit Photoshop which also mounts and ejects the RAM-Disk

Ok, my bad. Well you basically answered my question so I’ll stop posting in the wrong forum.