{"id":363,"date":"2013-03-24T00:06:03","date_gmt":"2013-03-23T16:06:03","guid":{"rendered":"https:\/\/macshuo.com\/?p=363"},"modified":"2013-06-02T00:08:06","modified_gmt":"2013-06-01T16:08:06","slug":"%e6%b2%a1%e4%bb%80%e4%b9%88%e4%ba%8b%e6%98%af%e5%ae%b9%e6%98%93%e7%9a%84","status":"publish","type":"post","link":"https:\/\/macshuo.com\/?p=363","title":{"rendered":"\u6ca1\u4ec0\u4e48\u4e8b\u662f\u5bb9\u6613\u7684"},"content":{"rendered":"<p><a href=\"https:\/\/macshuo.com\/wp-content\/uploads\/2013\/06\/cool.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/macshuo.com\/wp-content\/uploads\/2013\/06\/cool.jpg\" alt=\"cool\" width=\"500\" height=\"298\" class=\"alignnone size-full wp-image-266\" \/><\/a><\/p>\n<p>\u6628\u5929\u7684\u6587\u7ae0\u5f15\u53d1\u4e86\u5f88\u591a\u521b\u4e1a\u8bfb\u8005\u7684\u53cd\u9988\uff0c\u5927\u5bb6\u7eb7\u7eb7\u8868\u793a\u521b\u4e1a\u96be\uff0c\u96be\u4e8e\u4e0a\u9752\u5929\u3002\u8fd8\u6709\u4e9b\u521a\u521a\u8fdb\u5165\u793e\u4f1a\u7684\u7ae5\u9774\uff0c\u89c9\u5f97\u505a\u8fd9\u4e8b\u96be\uff0c\u5e72\u90a3\u4e8b\u82e6\uff0c\u8bf4\u600e\u4e48\u624d\u80fd\u627e\u5230\u4e00\u4e2a\u8f7b\u677e\u7684\u3001\u611f\u5174\u8da3\u7684\u3001\u6323\u94b1\u591a\u7684\u3001\u5de5\u4f5c\u65f6\u95f4\u5f39\u6027\u7684\u3001\u4e0d\u52a0\u73ed\u7684\u5de5\u4f5c\u5462\uff1f<\/p>\n<p>\u597d\u5427\uff0c\u4e0d\u5f97\u4e0d\u544a\u8bc9\u8fd9\u4e9b\u7ae5\u9774\u4e00\u4e2a\u6b8b\u9177\u7684\u4e8b\u5b9e\uff0c\u6728\u6709\u8fd9\u6837\u7684\u5de5\u4f5c\uff0c\u6709\u7684\u8bdd\u6211\u65e9\u53bb\u4e86\u3002\u5de5\u4f5c\u82e6\u70b9\u7d2f\u70b9\u4e0d\u7b97\u4ec0\u4e48\uff0c\u5c24\u5176\u662f\u5bf9\u5e74\u8f7b\u4eba\uff0c\u6211\u77e5\u9053\u5f88\u591a\u521b\u4e1a\u516c\u53f8\u7684\u8d44\u91d1\u6ca1\u95ee\u9898\uff0c\u6709\u7528\u6237\u6709\u6d41\u91cf\uff0c\u4f46\u7a81\u7136\u8fd9\u516c\u53f8\u5c31\u6ca1\u4e86\uff0c\u4e3a\u4ec0\u4e48\uff1f\u4e1a\u52a1\u4e0d\u589e\u957f\u4e86\uff0c\u7528\u6237\u5f00\u59cb\u6d41\u5931\u4e86\uff0c\u800c\u4e14\u627e\u4e0d\u5230\u7b56\u7565\u5e94\u5bf9\u8fd9\u6837\u7684\u6d41\u5931\u3002\u8fd9\u5c31\u50cf\u662f\u4e00\u7fa4\u70ed\u8840\u9752\u5e74\u8d70\u5728\u5e73\u5766\u7684\u5eb7\u5e84\u5927\u9053\u4e0a\uff0c\u4e00\u5207\u90fd\u90a3\u4e48\u7f8e\u597d\uff0c\u5929\u84dd\u4e91\u767d\uff0c\u7ea2\u65e5\u9752\u8349\uff0c\u7a81\u7136\u53d1\u73b0\u8def\u7684\u5c3d\u5934\u662f\u4e2a\u65e0\u6cd5\u903e\u8d8a\u7684\u9e3f\u6c9f\uff0c\u8fd9\u624d\u662f\u8ba9\u4eba\u5fc3\u788e\u7684\u60b2\u54c0\uff01<\/p>\n<p>\u7ecf\u8fc7\u5f88\u591a\u5e74\u6211\u624d\u77e5\u9053\uff0c\u4e16\u4e0a\u6ca1\u4ec0\u4e48\u4e8b\u662f\u5bb9\u6613\u7684\uff0c\u5373\u4f7f\u6709\uff0c\u4e5f\u5c5e\u4e8e\u522b\u4eba\u3002<\/p>\n<hr \/>\n<p>\u4eca\u5929\u5728Github\u4e0a\u653e\u4e86\u4e00\u4e2aAlfred\u7684workflow\uff0c\u53eb\u505aPlay Mdeia\uff0c\u57fa\u4e8ePython\u548cmdfind\u6784\u5efa\uff0c\u5927\u698230\u51e0\u884c\u4ee3\u7801\uff0c\u975e\u5e38\u7b80\u5355\uff0c\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u4e0b\uff1a<br \/>\nAlfred\u662fOS X\u6700\u5e38\u7528\u7684\u4e00\u6b3e\u589e\u5f3a\u578b\u5de5\u5177\u8f6f\u4ef6\uff0c\u5145\u5206\u5229\u7528\u4e86OS X\u7684\u8fd9\u4e9b\u7279\u6027\uff0c\u5e2e\u52a9\u7528\u6237\u901a\u8fc7\u5feb\u6377\u952e\u5b8c\u6210\u5404\u79cd\u5e38\u7528\u64cd\u4f5c\uff0c\u5c5e\u4e8eMac\u5fc5\u5907\u8f6f\u4ef6\u3002 \u8fd1\u671fAlfred\u53d1\u5e03\u4e86V2\uff0c\u5bf9\u539f\u6709\u7279\u6027\u8fdb\u884c\u4e86\u589e\u5f3a\u548c\u5b8c\u5584\uff0c\u5e76\u63a8\u51fa\u4e86\u5168\u65b0\u7684workflow\u529f\u80fd\uff0c\u63d0\u4f9b\u4e86\u6781\u4e3a\u7b80\u6d01\u7684\u63a5\u53e3\u548c\u5404\u79cdAction\uff0c\u5e2e\u52a9\u7528\u6237\u5b9a\u5236\u81ea\u5df1\u6240\u9700\u529f\u80fd\u3002<\/p>\n<h1>Introduction<\/h1>\n<p>Play Mdeia\u662f\u4e3aAlfred\u5f00\u53d1\u7684\u4e00\u6b3eworkflow\uff0c\u4e3b\u8981\u529f\u80fd\u5c31\u662f\u5feb\u901f\u5b9a\u4f4dMac\u4e2d\u7684\u97f3\u89c6\u9891\u6587\u4ef6\uff0c\u5e76\u901a\u8fc7\u5408\u9002\u7684\u64ad\u653e\u5668\u64ad\u653e\u3002<br \/>\n\u8fd9\u4e2aworkflow\u7684\u9700\u6c42\u6765\u81ea\u4e8e\u6211\u4e2a\u4eba\u7684\u4f7f\u7528\u4e60\u60ef\u3002\u6211\u662f\u91cd\u5ea6Podcast\u548ciTune U\u7528\u6237\uff0c\u5728iTunes App Store\u4e0a\u8ba2\u9605\u4e86\u5927\u91cf\u7684\u516c\u5f00\u8bfe\u89c6\u9891\uff0c\u5305\u62ecWWDC\u4e0a\u8fd1\u5e74\u7684\u89c6\u9891\uff0c\u6709\u65f6\u5019\u6211\u9700\u8981\u5feb\u901f\u627e\u5230\u67d0\u4e2a\u4e3b\u9898\uff0c\u6253\u5f00\u67e5\u770b\uff0c\u4f46\u662f\u5728iTunes\u91cc\u67e5\u627e\u975e\u5e38\u9ebb\u70e6\uff0c\u8981\u64cd\u4f5c\u5f88\u591a\u6b65\u9aa4\u624d\u884c\u3002<br \/>\nAlfred\u672c\u8eab\u63d0\u4f9b\u7684\u64ad\u653eiTunes\u7684\u529f\u80fd\uff0c\u4e5f\u6ca1\u6cd5\u6ee1\u8db3\u8fd9\u4e2a\u9700\u6c42\uff0c\u6bd4\u5982\u4f60\u6253\u5f00Alfred 2\u7684iTunes Mini Player\uff0c\u60f3\u67e5\u627eiTunes U\u91cc\u7684\u5185\u5bb9\u662f\u67e5\u4e0d\u5230\u7684\u3002\u800c\u76f4\u63a5\u4f7f\u7528Alfred\u7684find\u529f\u80fd\u4f1a\u67e5\u51fa\u4e00\u5806\u4e0d\u76f8\u5173\u7684\u5185\u5bb9\uff0c\u6bd4\u5982\u4f60\u60f3\u67e5\u770b\u4e00\u4e2a\u548cimage\u5904\u7406\u7684\u89c6\u9891\uff0c\u7ed3\u679c\u53ef\u80fd\u627e\u51fa\u4e86\u4e00\u5806\u56fe\u7247\u3001\u5305\u542bimage\u7684\u6587\u4ef6\u5939\u3001pdf\u7b49\u7b49\u3002<\/p>\n<p>\u6240\u4ee5\u53ea\u597d\u5199\u4e00\u4e2a\uff0c\u8fd9\u662fPlay Mdeia\u7684\u7531\u6765\uff0c\u5982\u679c\u60a8\u6709\u7c7b\u4f3c\u9700\u6c42\uff0c\u4e5f\u53ef\u4ee5\u7528\u3002<\/p>\n<h1>Development<\/h1>\n<p>Alfred 2\u7684workflow\u63d0\u4f9b\u4e86\u591a\u79cd\u5b9e\u73b0\u65b9\u5f0f\uff0c\u6bd4\u5982shell\u3001php\u3001perl\u3001python\u3001ruby\u548capplescript\uff0c\u6700\u8fd1\u4f7f\u7528python\u6bd4\u8f83\u591a\uff0c\u6240\u4ee5\u4f7f\u7528Python 2.7\u7ed3\u5408OS X\u7684mdfind\u547d\u4ee4\u5b9e\u73b0\u4e86\u97f3\u89c6\u9891\u6587\u4ef6\u68c0\u7d22\u7684\u529f\u80fd\u3002<\/p>\n<p>mdfind\u662fspotlight\u7684\u547d\u4ee4\u884c\u5b9e\u73b0\uff0c\u529f\u80fd\u5f3a\u5927\uff0c\u53ef\u4ee5\u5b9a\u5236\u5404\u79cd\u590d\u6742\u67e5\u8be2\uff0c\u5feb\u901f\u68c0\u7d22\uff0c\u4f8b\u5982\u8fd9\u91cc\u7528\u5230\u7684\u547d\u4ee4\uff1a<\/p>\n<pre><code>mdfind \"kMDItemFSName == '*xcode*'c &amp;&amp; ( kMDItemKind == 'MP3*' || kMDItemKind == 'QuickTime*' || kMDItemKind == 'Video Media' ) \"\n<\/code><\/pre>\n<p>\u8fd9\u4e2a\u547d\u4ee4\u7684\u542b\u4e49\u662f\u68c0\u7d22\u5305\u542bxcode\u6587\u4ef6\u540d\u7684\u97f3\u89c6\u9891\u6587\u4ef6\uff0c\u4e0d\u533a\u5206\u5927\u5c0f\u5199\u3002<\/p>\n<p>\u68c0\u7d22\u5b8c\u6210\u540e\u901a\u8fc7python\u7ec4\u7ec7\u6210Alfred 2\u80fd\u8bc6\u522b\u7684xml\u683c\u5f0f\u5373\u53ef\u3002<\/p>\n<p>\u7136\u540e\u5c31\u662f\u4f7f\u7528Alfred 2\u63d0\u4f9b\u7684Actions\u5b8c\u6210\u811a\u672c\u529f\u80fd\u3001\u6253\u5f00\u6587\u4ef6\u3001\u6253\u5f00\u6587\u4ef6\u6240\u5728Finder\u7b49\u7b49\uff0c\u4e00\u4e2a\u63d2\u4ef6\u5c31\u5b8c\u6210\u4e86\u3002<\/p>\n<h1>Requirements<\/h1>\n<ul>\n<li>Python2.7 \uff08OS X 10.8\u9ed8\u8ba4\u7684Python\u7248\u672c\uff09<\/li>\n<li>Alfred 2\uff08\u4ed8\u8d39\u7248\uff09<\/li>\n<\/ul>\n<h1>Installation<\/h1>\n<p>\u4e0b\u8f7dPlay Media.alfredworkflow\uff0c\u53cc\u51fb\u5bfc\u5165Alfred 2\u5373\u53ef\u3002<\/p>\n<h1>How to use<\/h1>\n<ul>\n<li>\u901a\u8fc7option+space\u547c\u51faAlfred\uff0c\u8f93\u5165saga image\uff0c\u5c31\u53ef\u4ee5\u770b\u5230\u6587\u4ef6\u540d\u5305\u542bimage\u7684\u97f3\u89c6\u9891\uff0c\u5982\u56fe\u6240\u793a\uff1a  <\/li>\n<li>\u7528\u4e0a\u4e0b\u65b9\u5411\u952e\u9009\u4e2d\u9700\u8981\u7684\u6587\u4ef6\uff0c\u56de\u8f66\u53ef\u4ee5\u76f4\u63a5\u6253\u5f00\u3002\u5bf9\u4e8emkv\u548cwmv\u7b49iTunes\u4e0d\u80fd\u64ad\u653e\u7684\u97f3\u89c6\u9891\u6587\u4ef6\uff0c\u4f1a\u76f4\u63a5\u4f7f\u7528\u7cfb\u7edf\u9ed8\u8ba4\u7a0b\u5e8f\u6253\u5f00\uff0c\u6bd4\u5982\u4f60\u5b89\u88c5\u7684\u5c04\u624b\u5f71\u97f3\u6216MPlayerX\uff0c\u5176\u4ed6\u5219\u91c7\u7528iTunes\u6253\u5f00\u3002<\/li>\n<li>\u7528\u4e0a\u4e0b\u65b9\u5411\u952e\u9009\u4e2d\u9700\u8981\u7684\u6587\u4ef6\uff0c\u6309\u4f4fcommand\u7136\u540e\u518d\u56de\u8f66\uff0c\u53ef\u4ee5\u5728Finder\u4e2d\u6253\u5f00\u6587\u4ef6\u6240\u5728\u7684\u6587\u4ef6\u5939\u3002<\/li>\n<\/ul>\n<p>\u6709\u9700\u8981\u7684\u7ae5\u9774\u70b9\u51fb{<a href=\"https:\/\/github.com\/jackychi\/PlayMedia\">\u539f\u6587<\/a>}\u53ef\u4ee5\u5230Github\u4e0a\u4e0b\u8f7d\u8fd9\u4e2aworkflow\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6628\u5929\u7684\u6587\u7ae0\u5f15\u53d1\u4e86\u5f88\u591a\u521b\u4e1a\u8bfb\u8005\u7684\u53cd\u9988\uff0c\u5927\u5bb6\u7eb7\u7eb7\u8868\u793a\u521b\u4e1a\u96be\uff0c\u96be\u4e8e\u4e0a\u9752\u5929\u3002\u8fd8\u6709\u4e9b\u521a\u521a\u8fdb &hellip; <a href=\"https:\/\/macshuo.com\/?p=363\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":""},"categories":[1],"tags":[45,51],"class_list":["post-363","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-alfred","tag-mdfind"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/macshuo.com\/index.php?rest_route=\/wp\/v2\/posts\/363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/macshuo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/macshuo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/macshuo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/macshuo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=363"}],"version-history":[{"count":1,"href":"https:\/\/macshuo.com\/index.php?rest_route=\/wp\/v2\/posts\/363\/revisions"}],"predecessor-version":[{"id":364,"href":"https:\/\/macshuo.com\/index.php?rest_route=\/wp\/v2\/posts\/363\/revisions\/364"}],"wp:attachment":[{"href":"https:\/\/macshuo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/macshuo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/macshuo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}