<?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>Xster.net &#187; AppleScript</title>
	<atom:link href="http://tech.xster.net/tag/applescript/feed/" rel="self" type="application/rss+xml" />
	<link>http://tech.xster.net</link>
	<description>Never relearn twice</description>
	<lastBuildDate>Fri, 20 Jan 2012 21:11:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Empty Home Directory in Windows Using Boot Camp 3.0</title>
		<link>http://tech.xster.net/tips/empty-home-directory-in-windows-using-boot-camp-3-0/</link>
		<comments>http://tech.xster.net/tips/empty-home-directory-in-windows-using-boot-camp-3-0/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 22:29:47 +0000</pubDate>
		<dc:creator>xiao</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[.Xauthority]]></category>
		<category><![CDATA[Access]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Boot Camp]]></category>
		<category><![CDATA[Bootcamp]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[empty]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[home]]></category>
		<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[X11]]></category>

		<guid isPermaLink="false">http://tech.xster.net/?p=126</guid>
		<description><![CDATA[Just got Snow Leopard and installed Boot Camp 3.0 on Windows? Boot Camp 3.0 is definitely a well welcomed update. The trackpad works much better now with 2 finger tap for secondary click, it finally works like in OS X. Even better, you can now access HFS+ without third party apps in Windows. Definitely nice [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p><img class="size-full wp-image-127 alignleft" title="ls -a" src="http://tech.xster.net/wp-content/uploads/2009/09/Screen-shot-2009-09-13-at-6.22.14-PM.png" alt="ls -a" width="155" height="204" /></p>
<p>Just got Snow Leopard and installed Boot Camp 3.0 on Windows? Boot Camp 3.0 is definitely a well welcomed update. The trackpad works much better now with 2 finger tap for secondary click, it finally works like in OS X. Even better, you can now access HFS+ without third party apps in Windows. Definitely nice for Windows 7 x64 users that MacDrive doesn&#8217;t even support. But one problem that seems to trouble people in the forums is that navigating to /Users/[yourname] in Windows shows an empty folder. You can&#8217;t access your music or pictures or anything from Windows.</p>
<p>One possibility is the presence of a .Xauthority file in your $HOME directory. Delete the file and you may access your home directory in Windows. Remember that running X11 will recreate the file. Delete it again.<span id="more-126"></span></p>
<p>To automate the whole process, consider creating a script that lets you boot into Windows worry free.</p>

<div class="wp_syntax"><div class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Finder&quot;</span>
	<span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #0066ff;">exists</span> <span style="color: #0066ff;">file</span> <span style="color: #009900;">&quot;~/.Xauthority&quot;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
		<span style="color: #0066ff;">delete</span> <span style="color: #0066ff;">file</span> <span style="color: #009900;">&quot;~/.Xauthority&quot;</span>
	<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span>
<span style="color: #0066ff;">do shell script</span> <span style="color: #009900;">&quot;bless -mount /Volumes/[your Windows device]/ -legacy -setBoot -nextonly&quot;</span> <span style="color: #ff0033; font-weight: bold;">with</span> administrator privileges
<span style="color: #0066ff;">do shell script</span> <span style="color: #009900;">&quot;shutdown -r now&quot;</span> <span style="color: #ff0033; font-weight: bold;">with</span> administrator privileges</pre></div></div>

<p>Put this in AppleScript editor and save it as a .app to make it executable. You can manpage the bless command for more options. You can also change the icon like any other app. At that point, you can invoke this via QuickSilver and a GUI dialog will prompt you for password.</p>
<p>It&#8217;s also possible that there are no .Xauthority files in the subdirectories so simply type in explorer the subdirectories to access them directly. ie: D:/Users/[you]/Desktop</p>
<div class="shr-publisher-126"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fempty-home-directory-in-windows-using-boot-camp-3-0%2F' data-shr_title='Empty+Home+Directory+in+Windows+Using+Boot+Camp+3.0'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fempty-home-directory-in-windows-using-boot-camp-3-0%2F' data-shr_title='Empty+Home+Directory+in+Windows+Using+Boot+Camp+3.0'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://tech.xster.net/tips/empty-home-directory-in-windows-using-boot-camp-3-0/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quake Style Drop Down Terminal for Mac</title>
		<link>http://tech.xster.net/tips/the-perfect-visor-reborn/</link>
		<comments>http://tech.xster.net/tips/the-perfect-visor-reborn/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 22:52:28 +0000</pubDate>
		<dc:creator>xiao</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[blacktree]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[perfect]]></category>
		<category><![CDATA[prompt]]></category>
		<category><![CDATA[quake]]></category>
		<category><![CDATA[SIMBL]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[TotalTerminal]]></category>
		<category><![CDATA[visor]]></category>

		<guid isPermaLink="false">http://tech.xster.net/?p=10</guid>
		<description><![CDATA[Update: Visor Terminal is now TotalTerminal. It&#8217;s a lot easier to configure so you can just download TotalTerminal and perform the steps below starting at 6. The Visor Terminal, one of my most used hack-features. This guide helps you put your Mac Terminal to the zenith of usability and convenience. The drop-down Quake-style terminal window [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p style="text-align: left;"><em><strong>Update: </strong>Visor Terminal is now <a href="http://totalterminal.binaryage.com/">TotalTerminal</a>. It&#8217;s a lot easier to configure so you can just download TotalTerminal and perform the steps below starting at 6.</em></p>
<p style="text-align: left;">The <a href="http://visor.binaryage.com/" target="_blank">Visor Terminal</a>, one of my most used hack-features. This guide helps you put your Mac Terminal to the zenith of usability and convenience.</p>
<div id="attachment_11" class="wp-caption alignleft" style="width: 650px"><img class="size-full wp-image-11" title="visor" src="http://tech.xster.net/wp-content/uploads/2009/03/visor.jpg" alt="Visor Terminal" width="640" height="261" /><p class="wp-caption-text">Visor Terminal</p></div>
<p>The drop-down Quake-style terminal window is extremely convenient to run commands without disrupting the current workflow. Unfortunately the default install is very messy. It needs an open terminal program running in the background which can&#8217;t be closed and takes up valuable Dock space.<span id="more-10"></span></p>
<p>Then comes a blog from <a href="http://blog.wombert.de/" target="_blank">David Zülke</a> who solved the problem with a <a href="http://blog.wombert.de/2006/11/04/the-perfect-visor/" target="_blank">hack</a> which essentially creates a second terminal program, links the visor extension to it and makes that second terminal always invisible and not appearing in the Dock by playing with the Info.plist file. The world was beautiful until I bought a new Macbook and tried to reinstall Visor but only to find out that his instructions are no longer hosted. So here are the instructions again for those who want a Perfect Visor. This is for version 1.5 &#8211; 2.2 which runs on Leopard &#8211; Snow Leopard.</p>
<ol>
<li>Install <a href="http://www.culater.net/software/SIMBL/SIMBL.php" target="_blank">SIMBL </a></li>
<li>This is not necessary but it&#8217;s a lot easier if you have <a href="http://developer.apple.com/TOOLS/xcode/" target="_blank">XCode</a> to use its .plist editor tool.</li>
<li>Right-click the extracted “Visor” file, select “Show Package Contents” and double-click “Info.plist” in the “Contents” folder[1]. Go to <code>Root</code>, <code>SIMBLTargetApplications</code>, <code>0</code> and change <code>BundleIdentifier</code> to “com.apple.VisorTerminal”. Save and close. You can now install the bundle according to the Visor install instructions (i.e. move it to ~/Library/Application Support/SIMBL/Plugins or the “global” equivalent in /Library).</li>
<li>Go to your Applications/Utilities folder and duplicate Terminal. Rename the copy to “VisorTerminal”, then right-click it and choose “Show Package Contents”, and double-click “Info.plist” in the “Contents” folder. Go to <code>Root</code> and change <code>CFBundleIdentifier</code> to “com.apple.VisorTerminal”. Save and close.</li>
<li>Start VisorTerminal. Go to Terminal menu and click Visor Preferences. Customize it to your suiting.</li>
<li>Make it run on start up. You can right click the VisorTerminal on Dock and choose &#8220;Open at Login&#8221;</li>
<li>Make it invisible. Right-click the VisorTerminal, choose “Show Package contents” and double-click Info.plist in the Contents folder. Add a new Sibling inside the root element called <code>LSUIElement</code>, it must be of type “Number” and have the value “1″ (without the quotes, of course). Save and quit.</li>
<li>Done and done! Now the Visor will start on startup and won&#8217;t show up anywhere until you press the hotkey.  If you don&#8217;t like your previous preferences, you can&#8217;t right click or use menu anymore but pressing cmd-, will bring up the preferences window for the terminal</li>
</ol>
<p>Currently, there&#8217;s a bug with SIMBL 0.97 that causes the application to stop using SIMBL when LSUIElement is set to 1. To solve this issue, use AppleScript with the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;VisorTerminal&quot;</span>
	inject SIMBL <span style="color: #0066ff;">into</span> Snow Leopard
	<span style="color: #0066ff;">activate</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span></pre></div></div>

<p>Then save the script as a .app in a desired location. Make this run at startup instead of VisorTerminal.</p>
<p>The next steps are optional but your default Darwin terminal prompt  looks like shit. Here&#8217;s how to customize it.</p>
<ol>
<li>Press your hotkey or open Terminal</li>
<li>Go to your home directory

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> ~</pre></div></div>

<p>You are there by default</li>
<li>Change your profile file

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mate .bash_profile</pre></div></div>

<p>TextMate is my favorite editor. If you don&#8217;t use it, use <code>nano</code> instead of <code>mate</code></li>
<li>Type

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> PS1 = <span style="color: #ff0000;">&quot; &quot;</span></pre></div></div>

<p>And customize your prompt with the following keywords between the quotes</p>
<ul>
<li>\d &#8211; Current date</li>
<li>\t &#8211; Current time</li>
<li>\h &#8211; Host name</li>
<li>\# &#8211; Command number</li>
<li>\u &#8211; User name</li>
<li>\W &#8211; Current working directory (ie: Desktop/)</li>
<li>\w &#8211; Current working directory, full path (ie: /Users/Admin/Desktop)</li>
</ul>
<p>ie.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PS1</span>=<span style="color: #ff0000;">&quot;\u@\h\w: &quot;</span></pre></div></div>

</li>
<li>Save and restart your terminal</li>
</ol>
<div class="shr-publisher-10"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fthe-perfect-visor-reborn%2F' data-shr_title='Quake+Style+Drop+Down+Terminal+for+Mac'></a><a class='shareaholic-tweetbutton' data-shr_count='none' data-shr_href='http%3A%2F%2Ftech.xster.net%2Ftips%2Fthe-perfect-visor-reborn%2F' data-shr_title='Quake+Style+Drop+Down+Terminal+for+Mac'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://tech.xster.net/tips/the-perfect-visor-reborn/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

