事務用の汎用Applescript

文字通り誰もがアプリケーションを見つけることができるいくつかのApplescriptソリューションの私自身の開発を共有したいと同時に、「汎用」の他の同様の普遍的なソリューションの例を聞きたいです。 ホットキーを使用してスクリプトを実行し、ボタンをバインドしてQuicksilverを介して必要なスクリプトを起動するように予約します。このバインドには5秒かかります。



そのため、アクティビティに関係なく文字通りすべての人に適した汎用スクリプトから、次のものを作成しました。

1.選択したファイルを、目的の件名、目的の本文、適切な受信者とともにメールで送信します。

property Myrecipient : "" property mysubject : "" property EmailBody : "" on run tell application "Finder" set sel to (get selection) end tell new_mail(sel) end run on open droppedFiles new_mail(droppedFiles) end open on new_mail(theFiles) tell application "Mail" set newMessage to make new outgoing message with properties {visible:true, subject:mysubject, content:EmailBody} tell newMessage make new to recipient with properties {address:Myrecipient} tell content repeat with oneFile in theFiles make new attachment with properties {file name:oneFile as alias} at after the last paragraph end repeat end tell end tell activate end tell end new_mail
      
      







2.目的のフォルダーを開きます。

 tell application "Finder" activate open folder "" of folder "" of folder "" of folder "Users" of startup disk end tell
      
      





3.ハイライトされた文字からリマインダーを作成します。

 tell application "Mail" using terms from application "Mail" set selectedMails to selection set theMessage to first item of selectedMails set theBody to "message:%3C" & message id of theMessage & "%3E" set theSubject to the subject of theMessage & " (From " & the sender of theMessage & ")" tell application "Reminders" set theList to list "Inbox" set newToDo to make new reminder with properties {name:theSubject, body:theBody, container:theList} end tell end using terms from end tell
      
      





4.文字をたとえば赤で塗りつぶします。

 tell application "Mail" set maillist to selection repeat with i from 1 to number of items in maillist set this_item to item i of maillist if class of this_item is message then set background color of this_item to red -- other colors are -- gray / green / orange / red end if end repeat end tell
      
      







5.フォルダーまたはファイルへのパスを取得します-たとえば、レターまたはチャットに挿入します。

 >tell application "Finder" set sel to the selection as text set the clipboard to POSIX path of sel end tell
      
      





Altを使用してホットキーを起動する最も便利な方法のように思えました。「パンシステム」呼び出しの場合、実際には無料です。一方、Cmdはアプリケーション内に多くの基本機能を備え、Ctrl そして、ここでalt + r-たとえば、リマインダーにメールを送信しました。



アクティビティの種類に関係なく、日常的な操作に役立つ可能性のあるスクリプトのアイデアをコメントで見て非常にうれしいです。



All Articles