20260614

AS記法 MakePDF フォルダ指定

AS記法 MakePDF フォルダ指定

NOTE記事一覧ですnote.com
 

【Safari・FireFox用Script Editorで開く】 |

Folder2PDFコンタクトシート.applescript.scpt
ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003(*
004
005先に設定
006その後で、実行
007
008com.cocolog-nifty.quicktimer.icefloe *)
009----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
010use AppleScript version "2.8"
011use scripting additions
012
013property refMe : a reference to current application
014
015set strBundleID to ("com.apple.MakePDF") as text
016
017############
018set aliasDefaultLocation to (path to desktop folder from user domain) as alias
019set strMes to "画像が入っているフォルダを選んでください" as text
020set strPrompt to "画像が入っているフォルダを選んでください" as text
021try
022   tell application "Finder"
023      tell application "SystemUIServer"
024         activate
025         set listAliasFolderPath to (choose folder strMes with prompt strPrompt default location aliasDefaultLocation with multiple selections allowed without invisibles and showing package contents)
026      end tell
027   end tell
028on error
029   log "エラーしました"
030   return "エラーしました"
031end try
032
033
034tell application id strBundleID to launch
035tell application id strBundleID to activate
036
037
038repeat with objAliasFolderPath in listAliasFolderPath
039   set aliasFolderPath to objAliasFolderPath as alias
040   
041   tell application id strBundleID to open aliasFolderPath
042   
043end repeat
044
045
046return true
AppleScriptで生成しました