てきとうなメモ

本の感想とか技術メモとか

Automatorでmake link on Safari

こんな感じかな.moinの例.右クリックからいければいいのだが

  1. サービスのテンプレートで新規作成
  2. 選択項目を入力なし,検索対象をSafariにする
  3. 以下のAppleScriptを実行
on run {input, parameters}
        
        (* Your script goes here *)
        tell application "Safari"
                set theTitle to name of current tab of window 0
                set theUrl to URL of current tab of window 0
        end tell
        
        set theText to "[[" & theUrl & "|" & theTitle & "]]"
        set the clipboard to theText as Unicode text
        return input
end run