
AS記法 MakePDF フォルダ指定
【Safari・FireFox用Script Editorで開く】 |
| ソース | |
|---|---|
| 001 | #!/usr/bin/env osascript |
| 002 | ----+----1----+----2----+-----3----+----4----+----5----+----6----+----7 |
| 003 | (* |
| 004 | |
| 005 | 先に設定 |
| 006 | その後で、実行 |
| 007 | |
| 008 | com.cocolog-nifty.quicktimer.icefloe *) |
| 009 | ----+----1----+----2----+-----3----+----4----+----5----+----6----+----7 |
| 010 | use AppleScript version "2.8" |
| 011 | use scripting additions |
| 012 | |
| 013 | property refMe : a reference to current application |
| 014 | |
| 015 | set strBundleID to ("com.apple.MakePDF") as text |
| 016 | |
| 017 | ############ |
| 018 | set aliasDefaultLocation to (path to desktop folder from user domain) as alias |
| 019 | set strMes to "画像が入っているフォルダを選んでください" as text |
| 020 | set strPrompt to "画像が入っているフォルダを選んでください" as text |
| 021 | try |
| 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 |
| 028 | on error |
| 029 | log "エラーしました" |
| 030 | return "エラーしました" |
| 031 | end try |
| 032 | |
| 033 | |
| 034 | tell application id strBundleID to launch |
| 035 | tell application id strBundleID to activate |
| 036 | |
| 037 | |
| 038 | repeat with objAliasFolderPath in listAliasFolderPath |
| 039 | set aliasFolderPath to objAliasFolderPath as alias |
| 040 | |
| 041 | tell application id strBundleID to open aliasFolderPath |
| 042 | |
| 043 | end repeat |
| 044 | |
| 045 | |
| 046 | return true |
| AppleScriptで生成しました | |
