Re: relative / absolute paths in AS
Re: relative / absolute paths in AS
- Subject: Re: relative / absolute paths in AS
- From: "Roger Howard" <email@hidden>
- Date: Mon, 07 Jan 2002 12:13:33 -0800
Jan,
AppleScript does have a basic relative path mechanism, as well as an even more useful path discovery mechanism... for instance:
"" as alias -- the parent path of the app running the script
path to me -- the path to the script (or host application itself)
path to startup disk -- gives yoou the path to the current startup disk
path to system folder -- current system folder
-- These all return aliases to the directory requested.
So in your example, if you wanted to always reference a folder named "test" on the desktop of whatever machine you are on, any of these would work:
path to startup disk & "Desktop Folder:test:" --
path to desktop & "test:"
tell application "Finder" to get folder "test" as string
-- These will all return text paths... you can coerce to aliases if needed.
Hope this helps,
Roger Howard
Digital Media Specialist
The J. Paul Getty Museum
email@hidden
310.440.6908
>
The problem is that this script is only running on my computer
>
because of the path: myPath : " HOMEBASE :Desktop Folder:test:"
>
>
On an other the computer the script does not work if it has a
>
differnt name for the harddisk.
>
>
Is it possible in AppleScript not to give a full path name? Like HTML-Links
>
where you can use a relative path? For example .../desktop/:test:?
>
So it runs on every machine?\