Google ChromeからPDFをEvernoteに保存するスクリプトを作成しましたが、同様に他のアプリからも簡単にEvernoteにPDFとして保存したい場合は以下のようなスクリプトになります。一般的なプリントダイアログを利用するアプリであれば利用できると思います。
[追記 2011/05/13] ループ等を修正しました。
[追記 2011/05/13] Chromeへの対応
-- LaunchBarから実行する場合は以下を有効にする -- tell application "LaunchBar" to hide tell application "System Events" -- AppleScript Editorから実行する場合は以下の2行を有効にする -- set theName to name of the first process whose frontmost is true -- set visible of process theName to false set theName to name of the first process whose frontmost is true end tell tell application theName to activate if theName is "Google Chrome" then printPDF2EvernoteChrome(theName) else printPDF2Evernote(theName) end if on printPDF2EvernoteChrome(theName) tell application "System Events" to tell process theName try keystroke "p" using command down repeat until exists menu button named "PDF" of window 1 delay 0.2 end repeat tell window 1 click menu button "PDF" repeat until exists menu item named "PDFをEvernoteに保存" of menu 1 of menu button "PDF" delay 0.2 end repeat click menu item named "PDFをEvernoteに保存" of menu 1 of menu button "PDF" end tell end try end tell end printPDF2EvernoteChrome on printPDF2Evernote(theName) tell application "System Events" to tell process theName try keystroke "p" using command down repeat 20 times if exists menu button named "PDF" of sheet 1 of window 1 then exit repeat delay 0.2 end repeat tell sheet 1 of window 1 click menu button "PDF" repeat 20 times if exists menu item named "PDFをEvernoteに保存" of menu 1 of menu button "PDF" then exit repeat delay 0.2 end repeat click menu item named "PDFをEvernoteに保存" of menu 1 of menu button "PDF" end tell end try end tell end printPDF2Evernote |