AppleScript名:選択したファイルパスに枝番を追加する |
— Created 2014-12-27 by Takaaki Naganoya — 2014 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" set aPOSIXpath to POSIX path of (choose file of type {"com.adobe.pdf"} with prompt "PDFを指定してください") set bPath to addStringbeforeExtension(aPOSIXpath, "_1") –> "/Users/me/Desktop/ryuoh01_1.pdf" on addStringbeforeExtension(aPath, extraString) set pathString to current application’s NSString’s stringWithString:aPath set theExtension to pathString’s pathExtension() set thePathNoExt to pathString’s stringByDeletingPathExtension() set newPath to (thePathNoExt’s stringByAppendingString:extraString)’s stringByAppendingPathExtension:theExtension return newPath as string end addStringbeforeExtension |
More from my site
(Visited 34 times, 1 visits today)