選択範囲の文字列をリマインダーに追加する方法
恐れ入ります。
AppleScriptで「選択範囲の文字列をリマインダーに追加するスクリプト」を作成、その後Automatorでショートカットの作成を試みた所、エラーが発生しました。
差し支えなければ、お心当たりのある方はご回答いただけると幸いです。
発生している問題・エラーメッセージ
Error: -1728. selectionを取り出すことができません
該当のソースコード
AppleScript
1try 2 set the clipboard to (get contents of selection) 3--「Error: -1728. selectionを取り出すことができません」 4on error the error_message number the error_number 5 display dialog "Error: " & the error_number & ". " & the error_message buttons {"Cancel"} default button 1 6end try 7 8set theName to the clipboard 9tell application "Reminders" 10 tell list "リスト名" 11 make new reminder with properties {name:theName, remind me date:current date, priority:9} 12 end tell 13end tell
試したこと
- スクリプトエディタでは成功
- Automatorだとエラー
他の方法で選択範囲の文字列を取得することを試みたり、contents of selectionについて調べたりしてみたのですが、解決には至らず、こちらで質問させていただきました。
不勉強で恐縮ですが、お知恵を拝借させていただけないでしょうか?
ご意見やご指摘、ご提案をお待ちしております。
補足情報(FW/ツールのバージョンなど)
macOS High Sierra バージョン10.13.6
スクリプトエディタ バージョン2.10
Automator バージョン2.8
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/10/25 01:19