Re: Converting Unix path to AppleScript path
Re: Converting Unix path to AppleScript path
- Subject: Re: Converting Unix path to AppleScript path
- From: Martin Orpen <email@hidden>
- Date: Wed, 29 Mar 2006 13:19:25 +0100
On 29 Mar 2006, at 12:57, has wrote:
Or, if you're not afraid of a bit of C, you could write a 10-line
scripting addition that uses a couple of Core Foundation calls to
convert the URL into a POSIX path.
You don't need to go to that much trouble to use obj-c:
objcString("file:///Volumes/Mag_Production/Color Lab Images/03:26/
Issue #9 prepressed/tm.0326.chinaRS.tiff")
on objcString(theString)
tell application "Automator"
set objcString to call method "stringWithString:" of class
"NSString" with parameter theString
set myEscapedURL to call method
"stringByReplacingPercentEscapesUsingEncoding:" of objcString
end tell
end objcString
-->"file:///Volumes/Mag_Production/Color Lab Images/03:26/Issue #9
prepressed/tm.0326.chinaRS.tiff"
From an example at my site:
<http://www.idea-digital.com/applescript/objc/page23/nsstring.html>
Regards
--
Martin Orpen
Idea Digital Imaging Ltd
_______________________________________________
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