<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Robo &#187; Applescripts</title>
	<atom:link href="http://robinramael.com/category/messing-around/applescripts/feed/" rel="self" type="application/rss+xml" />
	<link>http://robinramael.com</link>
	<description>is mostly harmless</description>
	<lastBuildDate>Tue, 13 Dec 2011 13:02:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='robinramael.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Robo &#187; Applescripts</title>
		<link>http://robinramael.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://robinramael.com/osd.xml" title="Robo" />
	<atom:link rel='hub' href='http://robinramael.com/?pushpress=hub'/>
		<item>
		<title>Dropbox in Snow Leopard (part deux revisited)</title>
		<link>http://robinramael.com/2009/10/09/dropbox-in-snow-leopard-part-deux-revisited/</link>
		<comments>http://robinramael.com/2009/10/09/dropbox-in-snow-leopard-part-deux-revisited/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 13:26:21 +0000</pubDate>
		<dc:creator>Robin Ramael</dc:creator>
				<category><![CDATA[Applescripts]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[Dropbox]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://robinramael.wordpress.com/?p=42</guid>
		<description><![CDATA[A few weeks ago I posted an applescript that could be used in an automator-service to automativally upload a file to your public dropbox and copy the URL to your clipboard. You can find that post here) The problem with that original applescript was that it only worked with filenames without spaces, which isn&#8217;t very [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robinramael.com&amp;blog=9238627&amp;post=42&amp;subd=robinramael&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago I posted an applescript that could be used in an automator-service to automativally upload a file to your public dropbox and copy the URL to your clipboard. You can find that post <a title="original post" href="http://robinramael.wordpress.com/2009/08/30/dropbox-in-snow-leopard-part-deux/">here</a>)</p>
<p>The problem with that original applescript was that it only worked with filenames without spaces, which isn&#8217;t very handy. After a long search on how to fix this in applescript i realized that I&#8217;m quite a dumbass for not just doing it in sed. I then added three lines to the original script and proceeded insulting myself in various languages.</p>
<p><span id="more-42"></span></p>
<p>The dropboxmover script 1.1:</p>
<p><pre class="brush: plain;">
(*
This applescript copies the selected file to the dropbox public folder and copies the URL to the clipboard and is intented for use within an automation. (created for Mac OSX 10.6 Services)
Created by Robin Ramael on 29th of august 2009
No rights reserved whatsoever

FILL IN YOUR DROPBOX USER ID BELOW!!!!
*)

on run {input, parameters}

	--FILL IN YOUR DROPBOX USER ID HERE
	set userid to 244025

	set dropboxpath to (path to home folder) &amp; &quot;Dropbox:Public:&quot; as string

	--Check if filesize isn't too big
	get size of (info for input)
	set filesize to result / 1000000
	if filesize is greater than 50 then
		say &quot;woaw&quot;
		display dialog &quot;This file is &quot; &amp; warningsize &amp; &quot; MB, are you sure you want to upload it to Dropbox?&quot; with icon caution
	end if

	--Copy file
	tell application &quot;Finder&quot;
		duplicate input to folder dropboxpath with replacing
		--Get the name of the file to put in clipboard later in the automation
		set filename to name of (info for input)
	end tell

	--make the filename URL suitable
	set filename to (do shell script &quot;echo \&quot;&quot; &amp; filename &amp; &quot;\&quot; | sed -e 's/\\ /%20/g'&quot;)
	set dURL to &quot;http://dl.getdropbox.com/u/&quot; &amp; userid &amp; &quot;/&quot; &amp; filename as string

	return dURL
end run
</pre></p>
<p>Thanks to <a href="http://monototo.wordpress.com/">monototo</a> from the comments for helping out</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robinramael.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robinramael.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robinramael.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robinramael.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/robinramael.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/robinramael.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/robinramael.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/robinramael.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robinramael.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robinramael.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robinramael.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robinramael.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robinramael.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robinramael.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robinramael.com&amp;blog=9238627&amp;post=42&amp;subd=robinramael&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://robinramael.com/2009/10/09/dropbox-in-snow-leopard-part-deux-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/aa9576161bb251ce62ead1d545c203fa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Robin Ramael</media:title>
		</media:content>
	</item>
		<item>
		<title>Dropbox in Snow Leopard (part deux)</title>
		<link>http://robinramael.com/2009/08/30/dropbox-in-snow-leopard-part-deux/</link>
		<comments>http://robinramael.com/2009/08/30/dropbox-in-snow-leopard-part-deux/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 07:53:48 +0000</pubDate>
		<dc:creator>Robin Ramael</dc:creator>
				<category><![CDATA[Applescripts]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[Automator]]></category>
		<category><![CDATA[Dropbox]]></category>
		<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://robinramael.wordpress.com/?p=9</guid>
		<description><![CDATA[You can do a lot of neat little things with the new automator services-template. In my last post I wrote about making a litle automation to replace a feature that wasn&#8217;t in dropbox in Snow Leopard, but you can go further. Why not make the service copy any selected file over to the dropbox public [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robinramael.com&amp;blog=9238627&amp;post=9&amp;subd=robinramael&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You can do a lot of neat little things with the new automator services-template. In my last post I wrote about making a litle automation to replace a feature that wasn&#8217;t in dropbox in Snow Leopard, but you can go further. Why not make the service copy any selected file over to the dropbox public folder and then copy the public URL to the clipboard.</p>
<p>It&#8217;s basically the same automation as in part one, but the applescript does more:</p>
<p>(UPDATED)</p>
<p style="padding-left:30px;"><span id="more-9"></span>1. Open up automator again and choose the services template.</p>
<p style="padding-left:30px;">2. At &#8220;Service receives selected&#8221; choose &#8220;all files and folders&#8221; in &#8220;all programs&#8221; (you can choose the finder too, but i don&#8217;t see why &#8220;all programs&#8221; would be an issue).</p>
<p style="padding-left:30px;">3. The workflow goes: &#8211;&gt; execute applescript &#8211;&gt; copy to clipboard</p>
<p style="padding-left:30px;">4. In the applescript section you write:</p>
<p><pre class="brush: plain;">&lt;(*Created by Robin Ramael on 29th of august 2009
Under Creative Commons License Attribution-NonCommercial (http://creativecommons.org/licenses/by-nc/3.0/)

FILL IN YOUR DROPBOX USER ID BELOW!!!!
*)

on run {input, parameters}
 
 (*FILL IN YOUR DROPBOX USER ID HERE*)
 set userid to 244025
(*FILL IN MAXIMUM FILESIZE  (in mb) HERE*)
 set maximumfilesize to 50


  
 set dropboxpath to (path to home folder) &amp; &quot;Dropbox:Public:&quot; as string
 
 (*Check if filesize isn't too big*)
 get size of (info for input)
 set filesize to result / 1000000
if filesize is greater than maximumfilesize then
 say &quot;woaw&quot;
 display dialog &quot;This file is larger than 50 mb, are you sure you want to upload it to Dropbox?&quot; with icon caution
 end if
 
 (*Copy file*)
 tell application &quot;Finder&quot;
 duplicate input to folder dropboxpath with replacing
 end tell
 
 (*Get the name of the file to put in clipboard later in the automation*)
 tell application &quot;Finder&quot;
 get name of (info for input)
 set filename to result
 set dURL to &quot;http://dl.getdropbox.com/u/&quot; &amp; userid &amp; &quot;/&quot; &amp; filename as string
 end tell
 
return dURL
end run</pre></p>
<p>(Replace the &#8216;xxxxxx&#8217;by your dropbox user id. Remember, you can get this ID by going to any of your public files in the browser and looking at the URL. For example, if you have the URL &#8220;http://dl.getdropbox.com/u/123456/file.txt&#8221;, 123456 is your user ID.</p>
<p>You also might have to replace the &#8220;smart quotes&#8221; with normal quotes, i&#8217;d put in</p>
<pre></pre>
<p>tags but there is no support for them with applescript&#8230;)</p>
<p style="padding-left:90px;">
<p style="padding-left:30px;">5. Save as &#8220;Copy to Public Dropbox and copy URL&#8221;  and we&#8217;re done! You can now go to any file , right-click it and click  &#8221;Copy to Public Dropbox and copy URL&#8221; or whatever you named it and voila, the file is copied to your dropbox and the URL is copied to your clipboard.</p>
<p style="padding-left:30px;">The applescript also checks if the filesize isn&#8217;t too big (default is larger than 50 mb, but you can change that) to make sure you don&#8217;t accidentally start uploading a 4 GB file to you tiny, tiny dropbox.</p>
<p style="padding-left:30px;">UPDATE:  This currently only works with some filenames. Filenames with spaces or presumably backslasher are &#8216;not yet supported.&#8217;I&#8217;ll have to poke myself for version 1.01.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robinramael.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robinramael.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robinramael.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robinramael.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/robinramael.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/robinramael.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/robinramael.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/robinramael.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robinramael.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robinramael.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robinramael.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robinramael.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robinramael.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robinramael.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robinramael.com&amp;blog=9238627&amp;post=9&amp;subd=robinramael&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://robinramael.com/2009/08/30/dropbox-in-snow-leopard-part-deux/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/aa9576161bb251ce62ead1d545c203fa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Robin Ramael</media:title>
		</media:content>
	</item>
		<item>
		<title>Dropbox in Snow Leopard (part one)</title>
		<link>http://robinramael.com/2009/08/30/dropbox-in-snow-leopard-part-one/</link>
		<comments>http://robinramael.com/2009/08/30/dropbox-in-snow-leopard-part-one/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 07:16:12 +0000</pubDate>
		<dc:creator>Robin Ramael</dc:creator>
				<category><![CDATA[Applescripts]]></category>
		<category><![CDATA[applescript]]></category>
		<category><![CDATA[Automator]]></category>
		<category><![CDATA[Dropbox]]></category>
		<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://robinramael.wordpress.com/?p=6</guid>
		<description><![CDATA[For some reason Dropbox doesn&#8217;t fully work in Mac OSX 10.6. You can upload files and whatnot, but one feature I really liked, isn&#8217;t there (yet). The feature that is still missing at this point is being able to copy the public URL of the file to the clipboard to send it through IM or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robinramael.com&amp;blog=9238627&amp;post=6&amp;subd=robinramael&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For some reason Dropbox doesn&#8217;t fully work in Mac OSX 10.6. You can upload files and whatnot, but one feature I really liked, isn&#8217;t there (yet).</p>
<p>The feature that is still missing at this point is being able to copy the public URL of the file to the clipboard to send it through IM or in a forum, etc. Using automator&#8217;s new services-feature, you can easily make something like this on your own:</p>
<p>UPDATED: Doesn&#8217;t work on all filenames.</p>
<p>AND UPDATED AGAIN: Dropbox now fixed this issue, rendering my &#8216;hard work&#8217;pointless. You can get it <a href="http://forums.getdropbox.com/topic.php?id=11683">here</a>.</p>
<p style="padding-left:30px;"><span id="more-6"></span>1. Open up automator and choose the services template.</p>
<p style="padding-left:30px;">2. At &#8220;Service receives selected&#8221; choose &#8220;all files and folders&#8221; in &#8220;all programs&#8221; (you can choose the finder too, but i don&#8217;t see why &#8220;all programs&#8221; would be an issue).</p>
<p style="padding-left:30px;">3. The workflow goes: &#8211;&gt; execute applescript &#8211;&gt; copy to clipboard</p>
<p style="padding-left:30px;">4. In the applescript section you write:</p>
<p style="text-indent:-39.3px;font:normal normal normal 12px/normal Verdana;color:#2f9600;padding-left:60px;margin:0 0 0 39.2px;"><span style="color:#000000;"><strong>on</strong> </span><span style="color:#0000ff;"><strong>run</strong></span><span style="color:#000000;"> {</span>input<span style="color:#000000;">, </span>parameters<span style="color:#000000;">}</span></p>
<p style="text-indent:-78.6px;font:normal normal normal 12px/normal Verdana;padding-left:60px;margin:0 0 0 78.5px;"><strong>set</strong> <span style="color:#2f9600;">userid</span> <strong>to</strong> xxxxxx</p>
<p style="text-indent:-78.6px;font:normal normal normal 12px/normal Verdana;min-height:15px;padding-left:60px;margin:0 0 0 78.5px;"><span style="white-space:pre;"><span style="white-space:normal;color:#5e6161;">&#8211;Get the name of the file to put in clipboard later in the automation</span></span></p>
<p style="text-indent:-78.6px;font:normal normal normal 12px/normal Verdana;padding-left:60px;margin:0 0 0 78.5px;"><strong>tell</strong> <span style="color:#0000ff;"><em>application</em></span> &#8220;Finder&#8221;</p>
<p style="text-indent:-117.8px;font:normal normal normal 12px/normal Verdana;padding-left:60px;margin:0 0 0 117.8px;"><strong>get</strong> <span style="color:#8d00df;">name</span> <strong>of</strong> (<span style="color:#0000c1;"><strong>info for</strong></span> <span style="color:#2f9600;">input</span>)</p>
<p style="text-indent:-117.8px;font:normal normal normal 12px/normal Verdana;padding-left:60px;margin:0 0 0 117.8px;"><strong>set</strong> <span style="color:#2f9600;">filename</span> <strong>to</strong> <span style="color:#8d00df;">result</span></p>
<p style="text-indent:-117.8px;font:normal normal normal 12px/normal Verdana;padding-left:60px;margin:0 0 0 117.8px;"><strong>set</strong> <span style="color:#2f9600;">dURL</span> <strong>to</strong> &#8220;http://dl.getdropbox.com/u/&#8221; &amp; <span style="color:#2f9600;">userid</span> &amp; &#8220;/&#8221; &amp; <span style="color:#2f9600;">filename</span> <strong>as</strong> <span style="color:#0000ff;"><em>string</em></span></p>
<p style="text-indent:-78.6px;font:normal normal normal 12px/normal Verdana;padding-left:60px;margin:0 0 0 78.5px;"><strong>end</strong> <strong>tell</strong></p>
<p style="text-indent:-78.6px;font:normal normal normal 12px/normal Verdana;min-height:15px;padding-left:60px;margin:0 0 0 78.5px;"><span style="white-space:pre;"> </span></p>
<p style="text-indent:-78.6px;font:normal normal normal 12px/normal Verdana;padding-left:60px;margin:0 0 0 78.5px;"><strong>return</strong> <span style="color:#2f9600;">dURL</span></p>
<p style="text-indent:-39.3px;font:normal normal normal 12px/normal Verdana;padding-left:60px;margin:0 0 0 39.2px;"><strong>end</strong> <span style="color:#0000ff;"><strong>run</strong></span></p>
<p style="padding-left:30px;">(Replace the &#8216;xxxxxx&#8217;by your dropbox user id. You can get this ID by going to any of your public files in the browser and looking at the URL. For example, if you have the URL &#8220;http://dl.getdropbox.com/u/123456/file.txt&#8221;, 123456 is your user ID.)</p>
<p style="padding-left:30px;">5. Save as &#8220;Copy public URL&#8221;  and we&#8217;re done! You can now go to any file (but it won&#8217;t have any effect unless you&#8217;re in the dropbox public folder), right-click it and click  &#8221;Copy public URL&#8221; or whatever you named it and voila!</p>
<p style="padding-left:30px;"><strong>UPDATE:  This currently only works with some filenames. Filenames with spaces or presumably backslasher are &#8216;not yet supported.&#8217;I&#8217;ll have to poke myself for version 1.01.</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robinramael.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robinramael.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robinramael.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robinramael.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/robinramael.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/robinramael.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/robinramael.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/robinramael.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robinramael.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robinramael.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robinramael.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robinramael.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robinramael.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robinramael.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robinramael.com&amp;blog=9238627&amp;post=6&amp;subd=robinramael&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://robinramael.com/2009/08/30/dropbox-in-snow-leopard-part-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/aa9576161bb251ce62ead1d545c203fa?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Robin Ramael</media:title>
		</media:content>
	</item>
	</channel>
</rss>
