Hello,
I'm new to AppleScript
Trying to write a script that will:
1. Select and copy the current Safari URL
2. Send it to bit.ly for URL Shortening
3. Copy the result to the clipboard
I've come up with this so far:
Unfortunately the result I'm getting on the clipboard is this whole line:
curl --url "https://api-ssl.bitly.com/v4/shorten" ¬
--data access_token=0c60279f1425ac413d021f797d8c96f7dc5834af&format=txt&longUrl=https://www.bbc.com/
instead of just the bit.ly of https://www.bbc.com
If anyone has any ideas of what I'm missing, would be really appreciated,
Thanks
Nick
I'm new to AppleScript
Trying to write a script that will:
1. Select and copy the current Safari URL
2. Send it to bit.ly for URL Shortening
3. Copy the result to the clipboard
I've come up with this so far:
property theURL : ""
property bitlyToken : "0c60279f1425ac413d021f797d8c96f7dc5834af"
tell application "Safari"
set theURL to URL of current tab of window 1
end tell
set shellScript to ("curl --url \"https://api-ssl.bitly.com/v4/shorten\" ¬
--data access_token=" & bitlyToken & "&format=txt&longUrl=" & theURL)
set the clipboard to shellScript
Unfortunately the result I'm getting on the clipboard is this whole line:
curl --url "https://api-ssl.bitly.com/v4/shorten" ¬
--data access_token=0c60279f1425ac413d021f797d8c96f7dc5834af&format=txt&longUrl=https://www.bbc.com/
instead of just the bit.ly of https://www.bbc.com
If anyone has any ideas of what I'm missing, would be really appreciated,
Thanks
Nick