Friday, December 15, 2017

#1 2012-09-30 05:02:27 pm

dsiglin
Member
Registered: 2012-09-30
Posts: 3

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.


Filed under: Script, login, ram disk

Offline

 

#2 2012-10-01 09:29:14 am

dsiglin
Member
Registered: 2012-09-30
Posts: 3

Re: Running a script at login to make a ramdisk

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.

Offline

 

#3 2012-10-01 12:16:32 pm

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11482
Website

Re: Running a script at login to make a ramdisk

Hi,

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


regards

Stefan

Offline

 

#4 2012-10-01 01:05:18 pm

dsiglin
Member
Registered: 2012-09-30
Posts: 3

Re: Running a script at login to make a ramdisk

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

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)