• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: relative / absolute paths in AS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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?\


  • Prev by Date: Re: relative / absolute paths in AS
  • Next by Date: Version of Illustrator 9.0x docs?
  • Previous by thread: Re: relative / absolute paths in AS
  • Next by thread: Quark disk lister (List Contents)
  • Index(es):
    • Date
    • Thread