AppleScript名:指定のパスのファイル名をUUIDにして拡張子を付け替える |
— Created 2017-09-13 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" property NSString : a reference to current application’s NSString property NSUUID : a reference to current application’s NSUUID set aFile to POSIX path of (choose file of type {"public.html"}) set aRes to changeFileNameWithUUID(aFile, "pdf") of me on changeFileNameWithUUID(aFile, newExt) set thePath to NSString’s stringWithString:aFile set path1 to thePath’s stringByDeletingLastPathComponent() set theName to NSUUID’s UUID()’s UUIDString() set path2 to (path1’s stringByAppendingPathComponent:theName)’s stringByAppendingPathExtension:newExt return path2 end changeFileNameWithUUID |
More from my site
(Visited 65 times, 1 visits today)