<?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>Brett Gross Photography &#187; AppleScript</title>
	<atom:link href="http://brettgrossphotography.com/category/mac/applescript/feed" rel="self" type="application/rss+xml" />
	<link>http://brettgrossphotography.com</link>
	<description>A dozen dozen?</description>
	<lastBuildDate>Fri, 04 Jun 2010 19:58:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Aperture 3 AppleScript- Albums by Import Session 03</title>
		<link>http://brettgrossphotography.com/2010/05/07/aperture-3-applescript-albums-by-import-session-03</link>
		<comments>http://brettgrossphotography.com/2010/05/07/aperture-3-applescript-albums-by-import-session-03#comments</comments>
		<pubDate>Fri, 07 May 2010 17:07:56 +0000</pubDate>
		<dc:creator>brett</dc:creator>
				<category><![CDATA[Aperture 3]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Aperture]]></category>

		<guid isPermaLink="false">http://brettgrossphotography.com/?p=520</guid>
		<description><![CDATA[Albums by Import Session
Version 03
Developed &#038; tested on Aperture 3.0.3
This AppleScript will ask the user to pick a Project and then proceed to create Albums based on the images&#8217; import groups. These Albums will be placed into a Folder in the Project named &#8220;Import Groups&#8221; 
Albums by Import Session 03.scpt
Copyright &#169; 2007, 2008, 2009 Brett [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Albums by Import Session</strong><br />
Version 03<br />
Developed &#038; tested on Aperture 3.0.3</p>
<p>This AppleScript will ask the user to pick a Project and then proceed to create Albums based on the images&#8217; import groups. These Albums will be placed into a Folder in the Project named &#8220;Import Groups&#8221; </p>
<p><a href='http://brettgrossphotography.com/wp-content/uploads/2010/05/Albums-by-Import-Session-03.scpt_.zip'>Albums by Import Session 03.scpt</a></p>
<hr /><small>Copyright &copy; 2007, 2008, 2009 Brett Gross<br /> This feed is for personal, non-commercial use only. <br />Digital Fingerprint:  c24ce0fc42ed817864f0da3694c76868</small>]]></content:encoded>
			<wfw:commentRss>http://brettgrossphotography.com/2010/05/07/aperture-3-applescript-albums-by-import-session-03/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LaunchBar Snow Leopard Service</title>
		<link>http://brettgrossphotography.com/2009/09/16/launchbar-snow-leopard-service</link>
		<comments>http://brettgrossphotography.com/2009/09/16/launchbar-snow-leopard-service#comments</comments>
		<pubDate>Thu, 17 Sep 2009 00:34:33 +0000</pubDate>
		<dc:creator>brett</dc:creator>
				<category><![CDATA[AppleScript]]></category>

		<guid isPermaLink="false">http://brettgrossphotography.com/2009/09/16/launchbar-snow-leopard-service</guid>
		<description><![CDATA[Here is a simple AppleScript to use in an Automator Service to get LaunchBar to show the selected text in big type (like LaunchBar will do with phone numbers):

on run {input, parameters}

	set theString to ("x-launchbar:large-type?string=" &#038; (item 1 of input)) as string
	log theString

	open location theString

	return input
end run
Just set up a service to take text from [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple AppleScript to use in an Automator Service to get LaunchBar to show the selected text in big type (like LaunchBar will do with phone numbers):</p>
<hr size=1 width="65%" align="center">
<pre>on run {input, parameters}

	set theString to ("x-launchbar:large-type?string=" &#038; (item 1 of input)) as string
	log theString

	open location theString

	return input
end run</pre>
<p>Just set up a service to take text from any application and have the sole action be an AppleScript. Easy!<br />
<!-- technorati tags start -->
<p style="text-align:right;font-size:10px;">Technorati Tags: <a href="http://www.technorati.com/tag/Automator" rel="tag">Automator</a></p>
<p><!-- technorati tags end --></p>
<hr /><small>Copyright &copy; 2007, 2008, 2009 Brett Gross<br /> This feed is for personal, non-commercial use only. <br />Digital Fingerprint:  c24ce0fc42ed817864f0da3694c76868</small>]]></content:encoded>
			<wfw:commentRss>http://brettgrossphotography.com/2009/09/16/launchbar-snow-leopard-service/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Color me Impressed &#8211; Automator Continues to Amaze</title>
		<link>http://brettgrossphotography.com/2009/02/02/color-me-impressed-automator-continues-to-amaze</link>
		<comments>http://brettgrossphotography.com/2009/02/02/color-me-impressed-automator-continues-to-amaze#comments</comments>
		<pubDate>Tue, 03 Feb 2009 00:07:43 +0000</pubDate>
		<dc:creator>brett</dc:creator>
				<category><![CDATA[Aperture Automation]]></category>
		<category><![CDATA[AppleScript]]></category>

		<guid isPermaLink="false">http://brettgrossphotography.com/2009/02/02/color-me-impressed-automator-continues-to-amaze</guid>
		<description><![CDATA[From its beginnings in Mac OS X Tiger, Automator has been getting rave reviews. Automator opens up automation for the non-technical and allows for practically anyone to create powerful workflows. Since I&#8217;ve been an AppleScripter since System 7 Pro I&#8217;ve never really used Automator much. I found its building blocks approach to be limiting and [...]]]></description>
			<content:encoded><![CDATA[<p>From its beginnings in Mac OS X Tiger, Automator has been getting rave reviews. Automator opens up automation for the non-technical and allows for practically anyone to create powerful workflows. Since I&#8217;ve been an AppleScripter since System 7 Pro I&#8217;ve never really used Automator much. I found its building blocks approach to be limiting and I could usually get more done faster with straight AppleScript. </p>
<p>Today I was thrown by what I could do with Automator easier and faster than straight AppleScript&#8230; </p>
<p><a href="http://brettgrossphotography.com/wp-content/uploads/2009/02/automator-aperture-extractmeta.jpg" onclick="window.open('http://brettgrossphotography.com/wp-content/uploads/2009/02/automator-aperture-extractmeta.jpg','popup','width=880,height=735,scrollbars=no,resizable=yes,toolbar=no,directories=no,location=no,menubar=no,status=yes,left=0,top=0');return false"><img src="http://brettgrossphotography.com/wp-content/uploads/2009/02/automator-aperture-extractmeta-tm.jpg" height="334" width="400" border="1" hspace="4" vspace="4" alt="Automator-Aperture-Extractmeta" /></a></p>
<p>I wrote an AppleScript to export the metadata from images so that I could keep things safely offsite&#8230; the AppleScript takes literally days to run on my 34,000 image Library. The above Automator Workflow is much, much faster but doesn&#8217;t export some of the tags that my AppleScript does&#8230; </p>
<p>Time to connect Automator and AppleScript&#8230;<br />
<!-- technorati tags start -->
<p style="text-align:right;font-size:10px;">Technorati Tags: <a href="http://www.technorati.com/tag/Aperture" rel="tag">Aperture</a>, <a href="http://www.technorati.com/tag/AppleScript" rel="tag">AppleScript</a>, <a href="http://www.technorati.com/tag/Automator" rel="tag">Automator</a></p>
<p><!-- technorati tags end --></p>
<hr /><small>Copyright &copy; 2007, 2008, 2009 Brett Gross<br /> This feed is for personal, non-commercial use only. <br />Digital Fingerprint:  c24ce0fc42ed817864f0da3694c76868</small>]]></content:encoded>
			<wfw:commentRss>http://brettgrossphotography.com/2009/02/02/color-me-impressed-automator-continues-to-amaze/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Aperture AppleScript &#8211; Make Hierarchal Keywords Real v4</title>
		<link>http://brettgrossphotography.com/2009/01/12/aperture-applescript-make-hierarchal-keywords-real-v4</link>
		<comments>http://brettgrossphotography.com/2009/01/12/aperture-applescript-make-hierarchal-keywords-real-v4#comments</comments>
		<pubDate>Tue, 13 Jan 2009 01:15:03 +0000</pubDate>
		<dc:creator>brett</dc:creator>
				<category><![CDATA[Aperture Automation]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Aperture]]></category>
		<category><![CDATA[Automation]]></category>

		<guid isPermaLink="false">http://brettgrossphotography.com/?p=351</guid>
		<description><![CDATA[I believe that v4 should have resolved issues that some users were experiencing with v3 (http://brettgrossphotography.com/2008/03/04/aperture-applescript-make-keywords-real-v03) crashing Aperture. 
Make Keywords Real
Current version: 04
Built on: Aperture 2.1 / Mac OS X 10.5.6
This AppleScript operates on the current selection.
This is an update to the previous update and should work properly now.
This AppleScript will make Aperture’s virtual keywords [...]]]></description>
			<content:encoded><![CDATA[<p>I believe that v4 should have resolved issues that some users were experiencing with v3 (http://brettgrossphotography.com/2008/03/04/aperture-applescript-make-keywords-real-v03) crashing Aperture. </p>
<p><strong>Make Keywords Real</strong><br />
Current version: 04<br />
Built on: Aperture 2.1 / Mac OS X 10.5.6<br />
This AppleScript operates on the current selection.</p>
<p>This is an update to the previous update and should work properly now.</p>
<p>This AppleScript will make Aperture’s virtual keywords real.</p>
<p>“Huh?”</p>
<p>If you make hierarchal keywords in Aperture (you are, aren’t you), parent keywords are not exported with masters when exporting with XMP nor are they exported when exporting images as other formats. You can, however, use those keywords to find your images. Thus if you tag an image with ‘Bald Eagle’ in the following keyword hierarchy:</p>
<p>Animal<br />
–> Wildlife<br />
—-> Bird<br />
——>Eagle<br />
——–>Bald Eagle</p>
<p>You can find your image by searching for ‘Bird’, but when you export that same image the term ‘Bird’ is nowhere to be found.</p>
<p>FWIW, IMHO this is something that should have a checkbox in the Export panel.</p>
<p><a href='http://brettgrossphotography.com/wp-content/uploads/2009/01/make-hierarchal-keywords-real-04scpt1.zip'>make-hierarchal-keywords-real-04scpt1</a></p>
<hr /><small>Copyright &copy; 2007, 2008, 2009 Brett Gross<br /> This feed is for personal, non-commercial use only. <br />Digital Fingerprint:  c24ce0fc42ed817864f0da3694c76868</small>]]></content:encoded>
			<wfw:commentRss>http://brettgrossphotography.com/2009/01/12/aperture-applescript-make-hierarchal-keywords-real-v4/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Sal&#8217;s Book</title>
		<link>http://brettgrossphotography.com/2008/12/31/sals-book</link>
		<comments>http://brettgrossphotography.com/2008/12/31/sals-book#comments</comments>
		<pubDate>Wed, 31 Dec 2008 21:36:46 +0000</pubDate>
		<dc:creator>brett</dc:creator>
				<category><![CDATA[AppleScript]]></category>

		<guid isPermaLink="false">http://brettgrossphotography.com/2008/12/31/sals-book</guid>
		<description><![CDATA[Wow&#8230; Sal&#8217;s AppleScript book (AppleScript 1-2-3) is real. More than that, it&#8217;s here: FedEx just dropped it off (oddly from a Penske truck&#8230;). Coauthored by Bill Cheeseman, the book is a brick. Thick as a brick, that is. It&#8217;s actually heavier than a regular brick. When I&#8217;d ordered it from PeachPit, I didn&#8217;t look at [...]]]></description>
			<content:encoded><![CDATA[<p>Wow&#8230; Sal&#8217;s AppleScript book (AppleScript 1-2-3) is real. More than that, it&#8217;s here: FedEx just dropped it off (oddly from a Penske truck&#8230;). Coauthored by Bill Cheeseman, the book is a brick. Thick as a brick, that is. It&#8217;s actually heavier than a regular brick. When I&#8217;d ordered it from PeachPit, I didn&#8217;t look at the page count (879) nor did I realize that it was part of the Apple Training Series. I wonder if an AppleScript certification course is in the works? </p>
<p>That would be nice. </p>
<p>Well, now I have even more incentive to finish The Sex Lives of Cannibals and my new John Shaw book as soon as possible. </p>
<p>Happy New Year!<br />
<!-- technorati tags start -->
<p style="text-align:right;font-size:10px;">Technorati Tags: <a href="http://www.technorati.com/tag/AppleScript" rel="tag">AppleScript</a></p>
<p><!-- technorati tags end --></p>
<hr /><small>Copyright &copy; 2007, 2008, 2009 Brett Gross<br /> This feed is for personal, non-commercial use only. <br />Digital Fingerprint:  c24ce0fc42ed817864f0da3694c76868</small>]]></content:encoded>
			<wfw:commentRss>http://brettgrossphotography.com/2008/12/31/sals-book/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aperture AppleScript &#8211; Export &amp; Restore Metadata</title>
		<link>http://brettgrossphotography.com/2008/12/10/aperture-applescript-export-restore-metadata</link>
		<comments>http://brettgrossphotography.com/2008/12/10/aperture-applescript-export-restore-metadata#comments</comments>
		<pubDate>Wed, 10 Dec 2008 13:09:53 +0000</pubDate>
		<dc:creator>brett</dc:creator>
				<category><![CDATA[Aperture]]></category>
		<category><![CDATA[AppleScript]]></category>

		<guid isPermaLink="false">http://brettgrossphotography.com/2008/12/10/aperture-applescript-export-restore-metadata</guid>
		<description><![CDATA[Aperture can export *some* of the metadata associated with your images quickly &#38; easily. It can&#8217;t, however, reimport that data nor can it export all of the metadata from your images. 
Hence these AppleScripts. 
The first one will export the metadata for all selected file. It will save the data to a text file with [...]]]></description>
			<content:encoded><![CDATA[<p>Aperture can export *some* of the metadata associated with your images quickly &amp; easily. It can&#8217;t, however, reimport that data nor can it export all of the metadata from your images. </p>
<p>Hence these AppleScripts. </p>
<p>The first one will export the metadata for all selected file. It will save the data to a text file with a header row so that you can determine what data corresponds to what column (easy import into database or spreadsheet). It will export EXIF, IPTC and some custom metadata. You can customize the order and determine what fields are exported by editing the &#8216;theIPTC&#8217; variable list. </p>
<p><a href='http://brettgrossphotography.com/wp-content/uploads/2008/12/export-metadata-to-file-06scpt1.zip'>export-metadata-to-file-06scpt1</a></p>
<p>The second script will read an export file (with header) and apply metadata to images based on their name. </p>
<p><a href='http://brettgrossphotography.com/wp-content/uploads/2008/12/restore-metadata-from-file-06scpt1.zip'>restore-metadata-from-file-06scpt1</a></p>
<p><!-- technorati tags start -->
<p style="text-align:right;font-size:10px;">Technorati Tags: <a href="http://www.technorati.com/tag/Aperture" rel="tag">Aperture</a>, <a href="http://www.technorati.com/tag/AppleScript" rel="tag">AppleScript</a></p>
<p><!-- technorati tags end --></p>
<hr /><small>Copyright &copy; 2007, 2008, 2009 Brett Gross<br /> This feed is for personal, non-commercial use only. <br />Digital Fingerprint:  c24ce0fc42ed817864f0da3694c76868</small>]]></content:encoded>
			<wfw:commentRss>http://brettgrossphotography.com/2008/12/10/aperture-applescript-export-restore-metadata/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Update iTunes Smart Playlists with Limits</title>
		<link>http://brettgrossphotography.com/2008/09/24/update-itunes-smart-playlists-with-limits</link>
		<comments>http://brettgrossphotography.com/2008/09/24/update-itunes-smart-playlists-with-limits#comments</comments>
		<pubDate>Wed, 24 Sep 2008 18:06:17 +0000</pubDate>
		<dc:creator>brett</dc:creator>
				<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[iTunes]]></category>

		<guid isPermaLink="false">http://brettgrossphotography.com/2008/09/24/update-itunes-smart-playlists-with-limits</guid>
		<description><![CDATA[I use Smart Playlists to load my iPhone. One of my smart playlists is songs that are rated 4 or 5 stars. Currently that amounts to 337 songs and 2.5GB. I don&#8217;t want to put 2.GB of music onto my iPhone (I do need room for photos, apps, movies, and audiobooks!). To limit the number [...]]]></description>
			<content:encoded><![CDATA[<p>I use Smart Playlists to load my iPhone. One of my smart playlists is songs that are rated 4 or 5 stars. Currently that amounts to 337 songs and 2.5GB. I don&#8217;t want to put 2.GB of music onto my iPhone (I do need room for photos, apps, movies, and audiobooks!). To limit the number of songs, I set the playlist to limit the number of songs to 100 (still a lot of music &#8211; 6 1/2 hours!). </p>
<p>When you set the limit to a certain number of songs (or size) you can choose how iTunes picks your songs. I chose &#8216;Randomly&#8217;. Once you do this, iTunes will keep that list of songs the same even if you rate new songs. This is not what I wanted. </p>
<p>The solution? Why, Google and AppleScript of course. </p>
<p>I Googled &#8220;itunes smart playlist randomly update&#8221; and eventually came across bbum&#8217;s blog at <a href="http://radio.weblogs.com/0100490/2002/12/09.html">http://radio.weblogs.com/0100490/2002/12/09.html</a>. He discovered that you can get iTunes to refresh the list of songs by selecting them and hitting delete. I figured that if you can do it manually then you should be able to script it. </p>
<p>This quick AppleScript will refresh the smart playlist named &#8220;Random Best 100&#8243;. Naturally, you can change the name to match your particular playlist. </p>
<blockquote><p><span style="color:224444;font-family: monospace;">
<pre>tell application "iTunes"
	set thePL to playlist "Random Best 100"
	delete every track of thePL
end tell
</pre>
<p></span></p></blockquote>
<p>Now to schedule it through iCal and I&#8217;m good to go.<br />
<!-- technorati tags start -->
<p style="text-align:right;font-size:10px;">Technorati Tags: <a href="http://www.technorati.com/tag/AppleScript" rel="tag">AppleScript</a>, <a href="http://www.technorati.com/tag/iTunes" rel="tag">iTunes</a></p>
<p><!-- technorati tags end --></p>
<hr /><small>Copyright &copy; 2007, 2008, 2009 Brett Gross<br /> This feed is for personal, non-commercial use only. <br />Digital Fingerprint:  c24ce0fc42ed817864f0da3694c76868</small>]]></content:encoded>
			<wfw:commentRss>http://brettgrossphotography.com/2008/09/24/update-itunes-smart-playlists-with-limits/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iTunes AppleScript: Backup Playlist 10</title>
		<link>http://brettgrossphotography.com/2008/08/19/itunes-applescript-backup-playlist-10</link>
		<comments>http://brettgrossphotography.com/2008/08/19/itunes-applescript-backup-playlist-10#comments</comments>
		<pubDate>Tue, 19 Aug 2008 12:33:11 +0000</pubDate>
		<dc:creator>brett</dc:creator>
				<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://brettgrossphotography.com/?p=239</guid>
		<description><![CDATA[I tend to buy stuff from the iTunes Store. I&#8217;ll bet that a lot of you do as well. I like iTunes&#8217; backup ability, but I don&#8217;t need a backup of all of my music nor do I want to burn a stack of DVDs when I just purchased a couple of albums. 
Hence this [...]]]></description>
			<content:encoded><![CDATA[<p>I tend to buy stuff from the iTunes Store. I&#8217;ll bet that a lot of you do as well. I like iTunes&#8217; backup ability, but I don&#8217;t need a backup of all of my music nor do I want to burn a stack of DVDs when I just purchased a couple of albums. </p>
<p>Hence this script.<br />
<span id="more-239"></span><br />
Simply it backs up the playlists you list in the p_backupPlayLists property. I use Smart Playlists to feed the script with my iTunes Store purchases. </p>
<p>It will file your media in the following top level folders: Books, Music &#038; Videos. Music is filed by name then album. Videos are organized by TV Show and PDFs are all filed together. </p>
<p>On run it will ask you for a destination folder and will create all of the folders it needs to do its backups. When completed it will report how many files it backed up. </p>
<p>Enjoy! </p>
<p><a href='http://brettgrossphotography.com/wp-content/uploads/2008/08/backup-playlists-10scpt.zip'>backup-playlists-10scpt</a></p>
<hr /><small>Copyright &copy; 2007, 2008, 2009 Brett Gross<br /> This feed is for personal, non-commercial use only. <br />Digital Fingerprint:  c24ce0fc42ed817864f0da3694c76868</small>]]></content:encoded>
			<wfw:commentRss>http://brettgrossphotography.com/2008/08/19/itunes-applescript-backup-playlist-10/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An AppleScript to Mount Server Volumes</title>
		<link>http://brettgrossphotography.com/2008/06/04/an-applescript-to-mount-server-volumes</link>
		<comments>http://brettgrossphotography.com/2008/06/04/an-applescript-to-mount-server-volumes#comments</comments>
		<pubDate>Wed, 04 Jun 2008 22:40:00 +0000</pubDate>
		<dc:creator>brett</dc:creator>
				<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://brettgrossphotography.com/2008/06/04/an-applescript-to-mount-server-volumes</guid>
		<description><![CDATA[A lot of people have asked me lately about mounting file servers based on certain user criteria. Usually this is based on whether or not a user is a member of certain user groups (faculty, graphics design, engineering&#8230;). This is actually a pretty easy task for a quick AppleScript and I&#8217;m going to present a [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of people have asked me lately about mounting file servers based on certain user criteria. Usually this is based on whether or not a user is a member of certain user groups (faculty, graphics design, engineering&#8230;). This is actually a pretty easy task for a quick AppleScript and I&#8217;m going to present a template script that you can use as well as instructions for customizing it to suit your particular needs. </p>
<p>The basic AppleScript command <span style="font-size: 10px; font-family: monospace; color: blue;">mount volume</span> is part of the Standard Additions. It accepts one main argument, the URL for the server including share point; as a string. You can also pass a username and password. </p>
<p>For example:
<div style="color: black; font-size: 10pt; padding: 2px; background-color: #F1F5F5; margin: 20px; padding: 10px"><span style="font-size: 10px; font-family: monospace; color: blue;">mount volume &#8220;afp://server.ip/share/&#8221;</span></div>
<p>If you have integrated into a single sign on solution like Open Directory, MIT Kerberos, or Active Directory (yes, they are all really Kerberos-based) then you don&#8217;t need a username or password at all. The System will try to use the user&#8217;s Kerberos credentials and the volume will mount without any additional user interaction needed. </p>
<p>Mounting the server volume is easy, the more difficult part is determining what volumes to mount. Really, if you&#8217;re going to have all users mount the same volume all the time you are better off using Managed Client with Workgroup Manager (a part of Mac OS X Server). Barring that you&#8217;ll need to build some logic into the system. </p>
<p>Generally there is some kind of identifier attached to a user&#8217;s directory entry. Usually this is based on which groups a user is in. For example, all engineers are in the &#8216;engineering&#8217; group and connect to the &#8216;Engineering&#8217; share and the designers are in the &#8220;Design&#8221; group and connect to the &#8220;Graphics_Design&#8221; and &#8220;ClipArt&#8221; shares. </p>
<p>For my sample, I will use the above logic. </p>
<p>First off, lets get info about the currently logged in user. We&#8217;ll use the Unix command <span style="font-size: 10px; font-family: monospace; color: blue;">id</span>. <span style="font-size: 10px; font-family: monospace; color: blue;">id</span> will respond with something that looks like this:</p>
<div style="color: black; font-size: 10pt; padding: 2px; background-color: #F1F5F5; margin: 20px; padding: 10px">uid=501(brett) gid=20(staff) groups=20(staff), 98(_lpadmin), 81(_appserveradm), 101(com.apple.sharepoint.group.1), 79(_appserverusr), 80(admin)</div>
<p>The following AppleScript code will get that result into the variable <span style="font-size: 10px; font-family: monospace; color: blue;">userInfo</span>:</p>
<div style="color: black; font-size: 10pt; padding: 2px; background-color: #F1F5F5; margin: 20px; padding: 10px"> <span style="font-size: 10px; font-family: monospace; color: blue;">set theScript to &#8220;/usr/bin/id&#8221;<br />
set userInfo to do shell script theScript</span></div>
<p>AppleScript supports the <span style="font-size: 10px; font-family: monospace; color: blue;">if&#8230; then&#8230; else&#8230;</span> construct. In my example no user is both and engineer and designer, but you can easily use multiple <span style="font-size: 10px; font-family: monospace; color: blue;">if&#8230; then&#8230;</span> blocks to handle users that could be part of multiple groups. </p>
<p>To mount volumes as per my above example, the following code would be added:</p>
<div style="color: black; font-size: 10pt; padding: 2px; background-color: #F1F5F5; margin: 20px; padding: 10px"><span style="font-size: 10px; font-family: monospace; color: blue;">if (userInfo contains &#8220;Engineering&#8221;) then<br />
&nbsp;&nbsp;	mount volume &#8220;afp://server.ip/Engineering/&#8221;</p>
<p>else if (userInfo contains &#8220;Engineering&#8221;) then<br />
&nbsp;&nbsp;	mount volume &#8220;afp://server.ip/Graphics_Design/&#8221;<br />
&nbsp;&nbsp;	mount volume &#8220;afp://server.ip/ClipArt/&#8221;</p>
<p>end if</span></div>
<p>It&#8217;s pretty easy to put it all together in Script Editor (in /Applications/AppleScript/) then save it as an Application. You can deploy this script to all of your systems using Remote Desktop and use Workgroup Manager to set it as a Login Item. </p>
<p>Enjoy! </p>
<p><!-- technorati tags start -->
<p style="text-align:right;font-size:10px;">Technorati Tags: <a href="http://www.technorati.com/tag/Apple" rel="tag">Apple</a>, <a href="http://www.technorati.com/tag/Mac OS X" rel="tag">Mac OS X</a>, <a href="http://www.technorati.com/tag/System Administration" rel="tag">System Administration</a></p>
<p><!-- technorati tags end --></p>
<hr /><small>Copyright &copy; 2007, 2008, 2009 Brett Gross<br /> This feed is for personal, non-commercial use only. <br />Digital Fingerprint:  c24ce0fc42ed817864f0da3694c76868</small>]]></content:encoded>
			<wfw:commentRss>http://brettgrossphotography.com/2008/06/04/an-applescript-to-mount-server-volumes/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Aperture 2 AppleScript &#8211; Snapshot Aperture v02</title>
		<link>http://brettgrossphotography.com/2008/04/01/aperture-2-applescript-snapshot-aperture-v02</link>
		<comments>http://brettgrossphotography.com/2008/04/01/aperture-2-applescript-snapshot-aperture-v02#comments</comments>
		<pubDate>Tue, 01 Apr 2008 15:25:39 +0000</pubDate>
		<dc:creator>brett</dc:creator>
				<category><![CDATA[Aperture]]></category>
		<category><![CDATA[AppleScript]]></category>

		<guid isPermaLink="false">http://brettgrossphotography.com/2008/04/01/aperture-2-applescript-snapshot-aperture-v02</guid>
		<description><![CDATA[Snapshot Aperture
Current version: 02
Built on: Aperture 2.1
This AppleScript allows you to select a number of Aperture Projects to export complete with master images. If a selected Project does not have all of its images online, the script will not export it and will tell you about it once it is done exporting the other Projects. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Snapshot Aperture</strong><br />
Current version: 02<br />
Built on: Aperture 2.1</p>
<p>This AppleScript allows you to select a number of Aperture Projects to export complete with master images. If a selected Project does not have all of its images online, the script will not export it and will tell you about it once it is done exporting the other Projects. </p>
<p><a href="http://brettgrossphotography.com/wp-content/uploads/2008/04/snapshot-aperture-02.scpt.zip">Snapshot Aperture 02.scpt.zip</a></p>
<p>PS- Yay Apple with these Aperture 2 updates! New AppleScript features with each dot-upgrade. Cool.<br />
PPS- And the 2.1 update has much improved AppleScript support. Double kudos.<br />
<!-- technorati tags start -->
<p style="text-align:right;font-size:10px;">Technorati Tags: <a href="http://www.technorati.com/tag/Aperture" rel="tag">Aperture</a>, <a href="http://www.technorati.com/tag/AppleScript" rel="tag">AppleScript</a></p>
<p><!-- technorati tags end --></p>
<hr /><small>Copyright &copy; 2007, 2008, 2009 Brett Gross<br /> This feed is for personal, non-commercial use only. <br />Digital Fingerprint:  c24ce0fc42ed817864f0da3694c76868</small>]]></content:encoded>
			<wfw:commentRss>http://brettgrossphotography.com/2008/04/01/aperture-2-applescript-snapshot-aperture-v02/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
