[軟體] 右鍵縮址

看板MAC (蘋果Mac)作者 (林帛亨加油!!!)時間14年前 (2011/04/18 23:45), 編輯推噓5(504)
留言9則, 5人參與, 最新討論串1/1
今天研究了一個晚上XD 因為我一直不想讀automator跟applescript的文件Orz 所以最後沒有達到我想要的功能 但也不差了 我本來預想的功能: 複製網址後,再想貼上短網址的地方右鍵"貼上短網址" 目前的功能: 選取網址後,右鍵選擇"縮址",到想貼上短網址的地方貼上 下面是教學,不用裝甚麼其他的軟體 另外因為我是使用英文的作業系統,所以下面的一些名稱都會用英文的 非常抱歉 1.到你的applications 裡面打開 automator 2.選擇 service 3.Service receives selected "URLs" in "any application" (URLs 跟 any application於下拉式選單中選取) 4.左上方搜尋框搜尋 applescript 5.將Run Applescript 拖至右方區塊 6.將Run Applescript 中文字方塊內容全部刪除 並貼上以下程式碼 (此段程式碼修改自http://tinyurl.com/5c43v9) on run {input, parameters} set the ClipURL to (input as string) ignoring case if ((characters 1 through 4 of ClipURL as string) is not "http") then set ClipURL to ("http://" & ClipURL) end if set curlCMD to "curl --stderr /dev/null \"http://tinyurl.com/api-create.php?url=" & ClipURL & "\"" -- Run the script and get the result: set tinyURL to (do shell script curlCMD) set the clipboard to tinyURL return tinyURL end ignoring end run 其中 set curlCMD to "curl --stderr /dev/null \"http://tinyurl.com/api-create.php?url=" & ClipURL & "\"" 為同一行 7.存檔,並取一個你喜歡的名字(這個名字將出現再右鍵選單中) 8.完成 謝謝指教 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.32.15.242 ※ 編輯: peacedove 來自: 114.32.15.242 (04/18 23:49)

04/18 23:49, , 1F
04/18 23:49, 1F

04/18 23:57, , 2F
突然想到這樣好像就必須要用cocoa的軟體才能用
04/18 23:57, 2F

04/18 23:57, , 3F
如果要放諸四海皆準好像還是要配合quicksilver才行Q_Q
04/18 23:57, 3F

04/19 00:01, , 4F
我參考的文章是要用textexpander 可是那個好像要錢Q_Q
04/19 00:01, 4F

04/19 01:54, , 5F
因為 service (服務) 本身就是 Cocoa only 的功能 ..
04/19 01:54, 5F

04/19 16:16, , 6F
不好意思,請問存檔後的檔案預設會在哪? (新手菜鳥)
04/19 16:16, 6F

04/19 16:48, , 7F
太方便了給推
04/19 16:48, 7F

04/19 17:17, , 8F
家目錄下的 /library/services
04/19 17:17, 8F

04/20 09:41, , 9F
感謝~~ 用了一天,超好用的^^
04/20 09:41, 9F
文章代碼(AID): #1Dh5o3aZ (MAC)
文章代碼(AID): #1Dh5o3aZ (MAC)