Previous | Index |
Specialist conversion methods
HFSPathFromURL:colonForPackages:
As above, except you specify whether package paths have colons appended
+ (NSString *)HFSPathFromURL:(NSURL *)theUrl colonForPackages:(BOOL)colonForPackagesFlag
theUrl = an NSURL
colonForPackagesFlag = whether to include trailing : in package paths
A string
Version 1.0.0
If possible, use BridgePlus script library’s ASify from command instead.
use scripting additions
use framework "Foundation"
use script "BridgePlus"
load framework
set aURL to Cocoaify (choose file)
--> (NSURL) file:///Users/shane/Desktop/Untitled%204.scptd/
set theResult to current application's SMSForder's HFSPathFromURL:aURL colonForPackages:true
theResult as text
--> "Macintosh HD:Users:shane:Desktop:Untitled 4.scptd:"
set theResult to current application's SMSForder's HFSPathFromURL:aURL colonForPackages:false
theResult as text
--> "Macintosh HD:Users:shane:Desktop:Untitled 4.scptd"