Preventing POSIX File to Alias Conversion from Inserting Leading Colon
Preventing POSIX File to Alias Conversion from Inserting Leading Colon
- Subject: Preventing POSIX File to Alias Conversion from Inserting Leading Colon
- From: Grant Erickson <email@hidden>
- Date: Sun, 16 Aug 2009 15:05:49 -0700
- Organization: Nuovation System Designs, LLC
- Thread-topic: Preventing POSIX File to Alias Conversion from Inserting Leading Colon
Is there a way to prevent POSIX file from inserting a leading colon to
relative paths, whether specified as literals or read as a value from
elsewhere?
I have the following script snippet:
...
tell theDisk
if 0 is equal to 1 then
-- Fails due to ':' insertion
set theBackground to POSIX file ".background/background.png"
else
-- Works
set theBackground to file ".background:background.png"
end if
end tell
set background picture of theOptions to theBackground
...
If I convert the POSIX path, I end up with ":.background:background.png"
which doesn't exist. Whereas, the string literal
".background:background.png" works correctly.
Ultimately, the POSIX literal will be replaced by a value accessed from a
property list record:
set theBackground to (|Background| of (|Options| of theView)) as POSIX
file
I can, of course, coerce the converted path to text, change the text item
delimiters, chop the first item and coerce it back to a file; however, that
seems like an unseemly solution.
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