<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-266324840564253354</id><updated>2024-09-17T10:33:26.434+12:00</updated><category term="applescript"/><category term="plugin"/><category term="quicksilver"/><category term="url"/><title type='text'>KiwiComms</title><subtitle type='html'>Just another ICT blog.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kiwicomms.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/266324840564253354/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://kiwicomms.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-266324840564253354.post-1553931476572919803</id><published>2008-03-02T23:59:00.008+13:00</published><updated>2008-03-04T21:11:27.198+13:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="applescript"/><category scheme="http://www.blogger.com/atom/ns#" term="plugin"/><category scheme="http://www.blogger.com/atom/ns#" term="quicksilver"/><category scheme="http://www.blogger.com/atom/ns#" term="url"/><title type='text'>ShortenURL AppleScript Plugin for QuickSilver</title><content type='html'>Here is a small AppleScript plugin for &lt;a href=&quot;http://blacktree.com/?quicksilver&quot;&gt;QuickSilver&lt;/a&gt;. It takes a text URL input, and converts it to a short URL using the &lt;a href=&quot;http://metamark.net/&quot;&gt;MetaMark.net&lt;/a&gt; REST API. The short URL is saved to the clipboard for pasting to a browser, or to an Email, IM, whatever. I&#39;ve also built in Growl support so that you get notification of what&#39;s going on.&lt;br /&gt;&lt;br /&gt;To use the script, copy the text below to a file named &quot;Shorten URL.scpt&quot;. Put this   file in your QuickSilver Actions folder, which is ~/Library/Application Support/Quicksilver/Actions/&quot;. Restart Quicksilver (press Command, Control, Q with a Quicksilver window open to restart it). Quicksilver will then automatically recognise the script and you&#39;re ready to go.&lt;br /&gt;&lt;br /&gt;To use, open Quicksilver, press &#39;.&#39; to get the text input, and enter a URL. There is some type checking in the script, so you can enter &quot;www.whatever.com&quot;, as well as &quot;http://www.whatever.com&quot;. The script will automatically add the &quot;http://&quot; if you don&#39;t want to type it. If you don&#39;t enter any text, or if you just run shortenURL straight from within Quicksilver, it will take the URL of the front page in Safari and convert that.&lt;br /&gt;&lt;br /&gt;The script will then convert the URL, notify you using Growl (if it&#39;s running), and put the resulting short URL in the clipboard. You can then paste this (Command-V) to wherever you&#39;d like it.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;using terms from application &quot;Quicksilver&quot;&lt;br /&gt; on process text longURL&lt;br /&gt;  -- Init&lt;br /&gt;  my growlRegister()&lt;br /&gt;  &lt;br /&gt;  -- If we didn&#39;t get a text string then grab the URL from Safari&lt;br /&gt;  if longURL is &quot;&quot; then&lt;br /&gt;   tell application &quot;Safari&quot;&lt;br /&gt;    if document 1 exists then&lt;br /&gt;     copy the URL of the front document to longURL&lt;br /&gt;    end if&lt;br /&gt;   end tell&lt;br /&gt;  end if&lt;br /&gt;  &lt;br /&gt;  -- Format the URL accordingly in case it was types sans http://&lt;br /&gt;  if (longURL does not start with &quot;http://&quot;) then&lt;br /&gt;   set longURL to &quot;http://&quot; &amp; longURL&lt;br /&gt;  end if&lt;br /&gt;  &lt;br /&gt;  -- Convert the longURL&lt;br /&gt;  set shellScript to (&quot;curl --url \&quot;http://metamark.net/api/rest/simple?long_url=&quot; &amp; longURL &amp; &quot;\&quot; &quot;)&lt;br /&gt;  &lt;br /&gt;  set shortURL to (do shell script shellScript)&lt;br /&gt;  &lt;br /&gt;  -- Display success message&lt;br /&gt;  growlNotify(&quot;Short URL now in clipboard:&quot;, shortURL)&lt;br /&gt;  &lt;br /&gt;  -- Open the shortURL in Safari to test it&lt;br /&gt;  --tell application &quot;Safari&quot;&lt;br /&gt;  --set URL of front document to shortURL&lt;br /&gt;  --end tell&lt;br /&gt;  &lt;br /&gt;  set the clipboard to shortURL&lt;br /&gt;  &lt;br /&gt; end process text&lt;br /&gt;end using terms from&lt;br /&gt;&lt;br /&gt;using terms from application &quot;GrowlHelperApp&quot;&lt;br /&gt; -- Register Growl&lt;br /&gt; on growlRegister()&lt;br /&gt;  tell application &quot;GrowlHelperApp&quot;&lt;br /&gt;   register as application &quot;Shorten URL&quot; all notifications {&quot;Alert&quot;} default notifications {&quot;Alert&quot;} icon of application &quot;Script Editor.app&quot;&lt;br /&gt;  end tell&lt;br /&gt; end growlRegister&lt;br /&gt; &lt;br /&gt; -- Notify using Growl&lt;br /&gt; on growlNotify(grrTitle, grrDescription)&lt;br /&gt;  tell application &quot;GrowlHelperApp&quot;&lt;br /&gt;   notify with name &quot;Alert&quot; title grrTitle description grrDescription application name &quot;Shorten URL&quot;&lt;br /&gt;  end tell&lt;br /&gt; end growlNotify&lt;br /&gt;end using terms from&lt;br /&gt;&lt;/code&gt;</content><link rel='replies' type='application/atom+xml' href='http://kiwicomms.blogspot.com/feeds/1553931476572919803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/266324840564253354/1553931476572919803' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/266324840564253354/posts/default/1553931476572919803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/266324840564253354/posts/default/1553931476572919803'/><link rel='alternate' type='text/html' href='http://kiwicomms.blogspot.com/2008/03/shortenurl-applescript-plugin-for.html' title='ShortenURL AppleScript Plugin for QuickSilver'/><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>