
AS記法 WEBページ作成 フォルダ指定
【Safari・FireFox用Script Editorで開く】 |
| ソース | |
|---|---|
| 001 | #!/usr/bin/env osascript |
| 002 | #coding: utf-8 |
| 003 | ----+----1----+----2----+-----3----+----4----+----5----+----6----+----7 |
| 004 | (* |
| 005 | |
| 006 | WEBページ作成 |
| 007 | フォルダ選択して中にある画像ファイルで処理 |
| 008 | |
| 009 | com.cocolog-nifty.quicktimer.icefloe *) |
| 010 | ----+----1----+----2----+-----3----+----4----+----5----+----6----+----7 |
| 011 | use AppleScript version "2.8" |
| 012 | use scripting additions |
| 013 | |
| 014 | property refMe : a reference to current application |
| 015 | |
| 016 | set strBundleID to ("com.apple.BuildWebPage") as text |
| 017 | |
| 018 | ############ |
| 019 | set aliasDefaultLocation to (path to desktop folder from user domain) as alias |
| 020 | set strMes to "画像が入っているフォルダを選んでください" as text |
| 021 | set strPrompt to "画像が入っているフォルダを選んでください" as text |
| 022 | try |
| 023 | tell application "Finder" |
| 024 | tell application "SystemUIServer" |
| 025 | activate |
| 026 | set listAliasFolderPath to (choose folder strMes with prompt strPrompt default location aliasDefaultLocation with multiple selections allowed without invisibles and showing package contents) |
| 027 | end tell |
| 028 | end tell |
| 029 | on error |
| 030 | log "エラーしました" |
| 031 | return "エラーしました" |
| 032 | end try |
| 033 | |
| 034 | |
| 035 | tell application id strBundleID to launch |
| 036 | tell application id strBundleID to activate |
| 037 | |
| 038 | |
| 039 | repeat with objAliasFolderPath in listAliasFolderPath |
| 040 | set aliasFolderPath to objAliasFolderPath as alias |
| 041 | |
| 042 | tell application id strBundleID to open aliasFolderPath |
| 043 | |
| 044 | end repeat |
| 045 | |
| 046 | ###保存先を開く |
| 047 | delay 3 |
| 048 | set aliasPicturesDir to (path to pictures folder from user domain) as alias |
| 049 | tell application "Finder" |
| 050 | tell folder aliasPicturesDir |
| 051 | set listAliasDirPath to (every folder) as alias list |
| 052 | end tell |
| 053 | end tell |
| 054 | |
| 055 | tell application "Finder" |
| 056 | set listAliasDirPathSorted to (sort of listAliasDirPath by creation date) as alias list |
| 057 | end tell |
| 058 | |
| 059 | set aliasNewDir to (last item of listAliasDirPathSorted) as alias |
| 060 | |
| 061 | tell application "Finder" |
| 062 | open location aliasNewDir |
| 063 | end tell |
| 064 | |
| 065 | tell application "Finder" to activate |
| 066 | |
| 067 | |
| 068 | return true |
| AppleScriptで生成しました | |
