AppleScript名:file URL String to alias |
— Created 2017-09-18 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" property |NSURL| : a reference to current application’s |NSURL| set aFile to choose file set aPOSIX to POSIX path of aFile set aFileURL to (|NSURL|’s fileURLWithPath:aPOSIX)’s absoluteString() as string –Target (file URL string) –> "file:///Users/maro/Documents/…. set aPath to ((|NSURL|’s URLWithString:aFileURL)’s |path|()) as string set bPath to (POSIX file aPath) as alias –> alias "Cherry:Users:maro:Documents/… |
More from my site
(Visited 43 times, 1 visits today)