<?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/"
	>

<channel>
	<title>deleteaso &#187; AppleScript</title>
	<atom:link href="http://deleteaso.com/category/applescript/feed/" rel="self" type="application/rss+xml" />
	<link>http://deleteaso.com</link>
	<description>When something's not working delete aso files</description>
	<lastBuildDate>Mon, 12 Apr 2010 16:01:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>AppleScript to mount Samba servers</title>
		<link>http://deleteaso.com/applescript-to-mount-samba-servers/</link>
		<comments>http://deleteaso.com/applescript-to-mount-samba-servers/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 13:53:30 +0000</pubDate>
		<dc:creator>julian</dc:creator>
				<category><![CDATA[AppleScript]]></category>

		<guid isPermaLink="false">http://deleteaso.com/?p=152</guid>
		<description><![CDATA[Our office is mainly a Windows shop, both employee computers and file servers. But being one of the few people who use a mac it&#8217;s always a pain to mount the necessary networked drives on a daily basis. So I took some time the other day to write an AppleScript that runs on login to [...]]]></description>
			<content:encoded><![CDATA[<p>Our office is mainly a Windows shop, both employee computers and file servers. But being one of the few people who use a mac it&#8217;s always a pain to mount the necessary networked drives on a daily basis. So I took some time the other day to write an AppleScript that runs on login to mount all the network drives I need to use throughout the day. It also checks my IP address to see if I am in the office or connected through VPN before trying to mount the drives.</p>
<p>Here is the script. I have masked out the ip addresses but you should be able to get the idea to set this up to use it for your needs.</p>

<div class="wp_syntax"><div class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #ff0033; font-weight: bold;">set</span> TheAddress <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">do shell script</span> <span style="color: #009900;">&quot;curl -f http://checkip.dyndns.org | awk '{print substr($6,1,13)}'&quot;</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">if</span> TheAddress <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;xxx.xxx.xx.xx&quot;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
    <span style="color: #808080; font-style: italic;">--display dialog &quot;Your OFFICE IP is : &quot; default answer (TheAddress)</span>
    mount_drives<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #ff0033; font-weight: bold;">else</span> <span style="color: #ff0033; font-weight: bold;">if</span> TheAddress <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #009900;">&quot;xxx.xxx.xx.xx&quot;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
    <span style="color: #808080; font-style: italic;">--display dialog &quot;Your VPN IP is : &quot; default answer (TheAddress)</span>
    mount_drives<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #ff0033; font-weight: bold;">else</span>
    <span style="color: #0066ff;">display dialog</span> <span style="color: #009900;">&quot;You aren't at work&quot;</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
&nbsp;
<span style="color: #ff0033; font-weight: bold;">on</span> mount_drives<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    mount volume <span style="color: #009900;">&quot;smb://xx.x.x.x/projects&quot;</span>
    mount volume <span style="color: #009900;">&quot;smb://x.x.x.x/dev&quot;</span>
<span style="color: #ff0033; font-weight: bold;">end</span> mount_drives</pre></div></div>

<p>To set this to run on login go to System Preferences>Accounts>and Login Items under your account. From there you can add the script to the list.</p>
]]></content:encoded>
			<wfw:commentRss>http://deleteaso.com/applescript-to-mount-samba-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
