I found that Google's API became unreliable since I wrote that post. Here's 
the script I use now:

*using terms from* *application* "Quicksilver"

       *on* *process text* theURL

               *set* shortURL *to* *do shell script* "curl 
https://is.gd/create.php -d 'format=simple' -d 'url=" & theURL & "'"

               *return* shortURL

       *end* *process text*

       

       --Note: For versions of Quicksilver prior to 1.0, remove the 
following three lines of code.

       *on* *get direct types*

               *return* {"Apple URL pasteboard type"}

       *end* *get direct types*

*end* *using terms from*



On Friday, 13 May 2016 15:51:45 UTC-6, Adam Rosenthal wrote:
>
> I've tried doing this, but when I press Enter, the QS window disappears 
> and nothing happens. I used the script you posted and put it 
> in ~/Library/Application Support/Quicksilver/Actions. Any idea what could 
> be going wrong?
>
> On Thursday, September 27, 2012 at 4:42:02 PM UTC+1, Jon Stovell wrote:
>>
>> If your objective is simply to have an action to shorten URLs in QS, 
>> Dennis, it might be simpler to create one using AppleScript and save it 
>> in ~/Library/Application Support/Quicksilver/Actions. I have the following 
>> code saved there as Shorten URL.scpt. I just get any URL into the first 
>> pane and select Shorten URL as the action in the second pane. The resulting 
>> short URL then appears in QS's first pane so that I can do other things 
>> with it.
>>
>> *using terms from* *application* "Quicksilver"
>>
>> *on* *process text* theURL
>>
>> *set* shortURL *to* *do shell script* "curl -s 
>> https://www.googleapis.com/urlshortener/v1/url -H 'Content-Type: 
>> application/json' -d \"{\\\"longUrl\\\": \\\"" & theURL & "\\\"}\" | awk 
>> '/\"id\":/{print substr($2, 2, length($2)-3)}'"
>>
>> *return* shortURL
>>
>> *end* *process text*
>>
>> *end* *using terms from*
>>
>> On Thursday, September 27, 2012 11:21:14 AM UTC-4, Dennis wrote:
>>>
>>> Thanks, that worked - I used NSStringPboardType from the picture (not 
>>> NSFilenamesPBoardType in your text) and QS shows the service as a text 
>>> action.  When it runs, I get no error, but the result doesn't display or 
>>> show up on the clipboard.  I think Terpstra developed this for LaunchBar, 
>>> so maybe the interaction is a bit different.  Do you have a suggestion for 
>>> how to get the results to the clipboard?  Here's the service, if it's 
>>> helpful https://www.dropbox.com/sh/2ofsrjba1fj15km/1HFNCnA6NT.  THANKS
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Quicksilver" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/blacktree-quicksilver.
For more options, visit https://groups.google.com/d/optout.

Reply via email to