{"id":1172,"date":"2019-05-20T21:17:16","date_gmt":"2019-05-20T13:17:16","guid":{"rendered":"http:\/\/van-yzt.com\/?p=1172"},"modified":"2019-05-20T21:17:16","modified_gmt":"2019-05-20T13:17:16","slug":"applescript-automator-%e5%bf%ab%e6%8d%b7%e9%94%ae%e5%bc%80%e5%85%b3%e8%93%9d%e7%89%99","status":"publish","type":"post","link":"https:\/\/huzi-baozi.com\/?p=1172","title":{"rendered":"Applescript + Automator = \u5feb\u6377\u952e\u5f00\u5173\u84dd\u7259"},"content":{"rendered":"<pre><code class=\"language-script\">tell application &quot;System Preferences&quot;   -- \u8fdb\u5165\u7cfb\u7edf\u9762\u677f\n    set the current pane to pane id &quot;com.apple.preferences.Bluetooth&quot;  -- \u8bbe\u7f6e\u5f53\u524dtab\u4e3a\u84dd\u7259\n    tell application &quot;System Events&quot;  -- \u89e6\u53d1\u7cfb\u7edf\u4e8b\u4ef6\n        tell process &quot;System Preferences&quot;  -- \u8fdb\u5165\u7cfb\u7edf\u9762\u677f\u7a0b\u5e8f\n            tell window &quot;Bluetooth&quot;  -- \u627e\u5230\u84dd\u7259\u7a97\u53e3\n                tell button 3  -- button 3\u662f\u5f00\u542f\/\u5173\u95ed\u84dd\u7259\u6309\u94ae\n                    click  -- \u70b9\u51fb\n                end tell\n            end tell\n        end tell\n        quit\n    end tell\nend tell\n<\/code><\/pre>\n<p>\u540c\u65f6\uff0c\u914d\u5408\u4e0aAutomator\uff0c\u5236\u4f5c\u6210\u4e00\u4e2aaction\uff0c\u518d\u4e3a\u8fd9\u4e2aaction\u6dfb\u52a0\u4e00\u4e2a\u5feb\u6377\u952e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>tell application &quot;System Preferences&quot; &#8212; \u8fdb\u5165\u7cfb\u7edf\u9762\u677f set the current pane to pane id &quot;com.apple.preferences.Bluetooth&quot; &#8212; \u8bbe\u7f6e\u5f53\u524dtab\u4e3a\u84dd\u7259 tell application &quot;System Events&quot; &#8212; \u89e6\u53d1\u7cfb\u7edf\u4e8b\u4ef6 tell process &quot;System Preferences&quot; &#8212; \u8fdb\u5165\u7cfb\u7edf\u9762\u677f\u7a0b\u5e8f tell window &quot;Bluetooth&quot; &#8212; \u627e\u5230\u84dd\u7259\u7a97\u53e3 tell button 3 &#8212; button 3\u662f\u5f00\u542f\/\u5173\u95ed\u84dd\u7259\u6309\u94ae click &#8212; \u70b9\u51fb end tell end tell end tell quit end tell end tell \u540c\u65f6\uff0c\u914d\u5408\u4e0aAutomator\uff0c\u5236\u4f5c\u6210\u4e00\u4e2aaction\uff0c\u518d\u4e3a\u8fd9\u4e2aaction\u6dfb\u52a0\u4e00\u4e2a\u5feb\u6377\u952e<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-1172","post","type-post","status-publish","format-standard","hentry","category-snippet"],"_links":{"self":[{"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/posts\/1172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1172"}],"version-history":[{"count":1,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/posts\/1172\/revisions"}],"predecessor-version":[{"id":1173,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=\/wp\/v2\/posts\/1172\/revisions\/1173"}],"wp:attachment":[{"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/huzi-baozi.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}