Re: Defing a Path correctly
Re: Defing a Path correctly
- Subject: Re: Defing a Path correctly
- From: Christopher Nebel <email@hidden>
- Date: Tue, 19 Jul 2005 12:40:29 -0700
On Jul 18, 2005, at 7:58 PM, David O'Connor wrote:
The default script is as follows:
do shell script "/Applications/Unreal\\ Tournament\\ 2004.app/
Contents/MacOS/Unreal\\ Tournament\\ 2004 -userlogo=../Anomaly/Help/
AnomalyLogo.bmp -mod=Anomaly &"
I understand enough to know that it will look for the app in
Applications, however my app resides in a folder on an external
firewire drive.
specifically: drive: HERMES, Folder: Games.
Because my UT application is on another drive and different folder
l need to change the parameters, however ... I don't know enough!
I made a calculated guess and put the volume name; HERMES instead
of applications, followed by Games but it did not like it.
l did consult the Applescript help, but got lost.
SO... anybody able to show me the error/s of my way?
The simplest answer to your immediate question is to drag the
relevant file into the Script Editor window -- it will insert the
complete POSIX path. It will not quote the path for you, but you
seem to understand how to do that already. The precise details of
POSIX paths are complex, but for most purposes, just remember that if
it's on your startup disk, start with "/"; if it's on another disk,
start with "/Volumes/<disk name>/", in your case, "/Volumes/
HERMES/". Disk names are case sensitive; the rest of the path is
case-sensitive if and only if the file system is. (HFS+ is not.)
Two other things you're going to smack into:
1. The path to your userlogo is specified as relative to the current
directory, but "do shell script" does not define where the current
directory is. Use "cd" to put yourself in the right place first, and
then go from there, e.g. "cd /Volumes/HERMES/Games; 'Unreal
Tournament 2004.app/Contents/MacOS/Unreal Tournament 2004' -
userlogo ../Anomoly/Help/AnomolyLogo.bmp"
2. Because of how "do shell script" monitors the launched process,
using "&" by itself will not background a process. You have to say
"&> /dev/null &".
If you plan to be using "do shell script" with any frequency, go read
TN2065, "do shell script in AppleScript" < http://developer.apple.com/
technotes/tn2002/tn2065.html>.
--Chris Nebel
AppleScript and Automator Engineering
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden