Re: Preventing POSIX File to Alias Conversion from Inserting Leading Colon
Re: Preventing POSIX File to Alias Conversion from Inserting Leading Colon
- Subject: Re: Preventing POSIX File to Alias Conversion from Inserting Leading Colon
- From: Grant Erickson <email@hidden>
- Date: Sun, 16 Aug 2009 16:49:45 -0700
- Organization: Nuovation System Designs, LLC
- Thread-topic: Preventing POSIX File to Alias Conversion from Inserting Leading Colon
On 8/16/09 4:01 PM, Mark J. Reed wrote:
> First, the conversion is correct. Since there's no leading / on the
> POSIX path, it's relative to the current working directory; the way to
> get the same relative nature in an HFS path is to put a leading colon
> on it.
>
> But the current working directory is not, in general, well-defined for
> an AppleScript process running out of Script Editor. Better to use
> use one of the "path to" commands to locate the folder containing the
> ".background" subfolder, or else use an absolute POSIX path.
>
> In this case, I'm not sure why the version of the HFS path with no
> leading colon works; probably has something to do with being inside a
> "tell disk" block.
>
> Absolute POSIX: /dir/subdir/file
> Absolute HFS: Volume:dir:subdir:file
>
> Relative POSIX: subdir/file
> Relative HFS: :subdir:file
Mark:
Thanks for the prompt reply and insights. The following seems to work well:
set theAlias to the name of theDisk
set thePath to the POSIX path of theAlias
set theBackground to POSIX file (thePath & "/" & |Background| of
(|Options| of theView))
Regards,
Grant
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden