[軟體] 右鍵縮址
今天研究了一個晚上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
04/18 23:57, 2F
→
04/18 23:57, , 3F
04/18 23:57, 3F
→
04/19 00:01, , 4F
04/19 00:01, 4F
推
04/19 01:54, , 5F
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
04/19 17:17, 8F
推
04/20 09:41, , 9F
04/20 09:41, 9F
MAC 近期熱門文章
22
55
PTT數位生活區 即時熱門文章