<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: AppleScript Shell</title>
	<atom:link href="http://www.red-sweater.com/blog/240/applescript-shell/feed" rel="self" type="application/rss+xml" />
	<link>http://www.red-sweater.com/blog/240/applescript-shell</link>
	<description>Mac &#38; Technology Writings by Daniel Jalkut</description>
	<pubDate>Thu, 28 Aug 2008 20:35:00 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: FredB</title>
		<link>http://www.red-sweater.com/blog/240/applescript-shell#comment-36291</link>
		<dc:creator>FredB</dc:creator>
		<pubDate>Fri, 22 Dec 2006 03:11:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/240/applescript-shell#comment-36291</guid>
		<description>Really nice!

Not a big deal but at first I thought you were talking about &lt;a href="http://en.wikipedia.org/wiki/Almquist_shell" rel="nofollow"&gt;ash&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Really nice!</p>
<p>Not a big deal but at first I thought you were talking about <a href="http://en.wikipedia.org/wiki/Almquist_shell" rel="nofollow">ash</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cameron Hayne</title>
		<link>http://www.red-sweater.com/blog/240/applescript-shell#comment-35848</link>
		<dc:creator>Cameron Hayne</dc:creator>
		<pubDate>Wed, 20 Dec 2006 18:29:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/240/applescript-shell#comment-35848</guid>
		<description>I have now received two reports of problems with Ash from people with Intel Macs, so I suspect there is a PowerPC vs Intel issue.
For these people, Ash fails on all AppleScripts with an error like the following:
Can't call method "get" on an undefined value at /usr/local/bin/ash line 1652,  line 1.

The problem is something to do with the Perl module "Mac::OSA::Simple" that is used to compile and execute the AppleScript.
I now vaguely recall something about some of the Perl modules that call Carbon having byte-order problems, so it's probably something like that in the Mac::OSA::Simple module that is causing the problem. (I don't have an Intel Mac, so I've only tested Ash on PowerPC.)

A work-around is to use Ash's command-line option "-osaMethod" to change the method used to execute the AppleScript to use the '/usr/bin/osascript' tool instead of using that Perl module. To do this, start Ash with the command:

ash -osaMethod osascript

Using the 'osascript' method in Ash is fine and you could change this to be the default by editing the Perl script and changing the variable 'defaultOsaMethod' on line 86. The only issue is that Ash will be slightly less efficient since with this method, it execs /usr/bin/osascript each time you execute an AppleScript command. Most people won't notice the small overhead this causes.</description>
		<content:encoded><![CDATA[<p>I have now received two reports of problems with Ash from people with Intel Macs, so I suspect there is a PowerPC vs Intel issue.<br />
For these people, Ash fails on all AppleScripts with an error like the following:<br />
Can&#8217;t call method &#8220;get&#8221; on an undefined value at /usr/local/bin/ash line 1652,  line 1.</p>
<p>The problem is something to do with the Perl module &#8220;Mac::OSA::Simple&#8221; that is used to compile and execute the AppleScript.<br />
I now vaguely recall something about some of the Perl modules that call Carbon having byte-order problems, so it&#8217;s probably something like that in the Mac::OSA::Simple module that is causing the problem. (I don&#8217;t have an Intel Mac, so I&#8217;ve only tested Ash on PowerPC.)</p>
<p>A work-around is to use Ash&#8217;s command-line option &#8220;-osaMethod&#8221; to change the method used to execute the AppleScript to use the &#8216;/usr/bin/osascript&#8217; tool instead of using that Perl module. To do this, start Ash with the command:</p>
<p>ash -osaMethod osascript</p>
<p>Using the &#8216;osascript&#8217; method in Ash is fine and you could change this to be the default by editing the Perl script and changing the variable &#8216;defaultOsaMethod&#8217; on line 86. The only issue is that Ash will be slightly less efficient since with this method, it execs /usr/bin/osascript each time you execute an AppleScript command. Most people won&#8217;t notice the small overhead this causes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Jalkut</title>
		<link>http://www.red-sweater.com/blog/240/applescript-shell#comment-35831</link>
		<dc:creator>Daniel Jalkut</dc:creator>
		<pubDate>Wed, 20 Dec 2006 17:18:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/240/applescript-shell#comment-35831</guid>
		<description>ssp: I'm not sure - I am almost always logged in as me, so it's not an issue in my case. I thought I heard something about Mac OS X getting better at running "login-less" at some point (10.4?). Maybe that is what Steve is alluding to.</description>
		<content:encoded><![CDATA[<p>ssp: I&#8217;m not sure - I am almost always logged in as me, so it&#8217;s not an issue in my case. I thought I heard something about Mac OS X getting better at running &#8220;login-less&#8221; at some point (10.4?). Maybe that is what Steve is alluding to.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Jalkut</title>
		<link>http://www.red-sweater.com/blog/240/applescript-shell#comment-35830</link>
		<dc:creator>Daniel Jalkut</dc:creator>
		<pubDate>Wed, 20 Dec 2006 17:16:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/240/applescript-shell#comment-35830</guid>
		<description>adrianm: it's just a step up from the "all at once" execution style of osascript.  With ash, you can play around with the script interactively. The example I pasted above was sort of a "staged" example in that I had already figured out how to do everything. But the interactiveness of ash is what makes it more useful for this type of thing - you can explore the results of commands and examine properties of AppleScript objects in order to figure out how to access what you want. Just like in Script Editor.</description>
		<content:encoded><![CDATA[<p>adrianm: it&#8217;s just a step up from the &#8220;all at once&#8221; execution style of osascript.  With ash, you can play around with the script interactively. The example I pasted above was sort of a &#8220;staged&#8221; example in that I had already figured out how to do everything. But the interactiveness of ash is what makes it more useful for this type of thing - you can explore the results of commands and examine properties of AppleScript objects in order to figure out how to access what you want. Just like in Script Editor.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adrianm</title>
		<link>http://www.red-sweater.com/blog/240/applescript-shell#comment-35827</link>
		<dc:creator>adrianm</dc:creator>
		<pubDate>Wed, 20 Dec 2006 17:10:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/240/applescript-shell#comment-35827</guid>
		<description>why not just use osascript -e ?
bash lets you write a multiline script before execution.</description>
		<content:encoded><![CDATA[<p>why not just use osascript -e ?<br />
bash lets you write a multiline script before execution.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Streza</title>
		<link>http://www.red-sweater.com/blog/240/applescript-shell#comment-35810</link>
		<dc:creator>Steve Streza</dc:creator>
		<pubDate>Wed, 20 Dec 2006 16:01:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/240/applescript-shell#comment-35810</guid>
		<description>ssp, it'll launch applications just fine, you just won't be able to see them on the remote machine.  You don't even have to be logged in through the OS X login panel.</description>
		<content:encoded><![CDATA[<p>ssp, it&#8217;ll launch applications just fine, you just won&#8217;t be able to see them on the remote machine.  You don&#8217;t even have to be logged in through the OS X login panel.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ssp</title>
		<link>http://www.red-sweater.com/blog/240/applescript-shell#comment-35715</link>
		<dc:creator>ssp</dc:creator>
		<pubDate>Wed, 20 Dec 2006 09:10:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/240/applescript-shell#comment-35715</guid>
		<description>Does this require you to be logged into the machine? I've always wondered what happens when running an AppleScript via ssh. Can it launch GUI applications and all although you don't have a desktop? Will it just fail? (Will it access the apps of the currently logged in user? I guess not, but you never know ;)</description>
		<content:encoded><![CDATA[<p>Does this require you to be logged into the machine? I&#8217;ve always wondered what happens when running an AppleScript via ssh. Can it launch GUI applications and all although you don&#8217;t have a desktop? Will it just fail? (Will it access the apps of the currently logged in user? I guess not, but you never know ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nicholas Riley</title>
		<link>http://www.red-sweater.com/blog/240/applescript-shell#comment-35661</link>
		<dc:creator>Nicholas Riley</dc:creator>
		<pubDate>Wed, 20 Dec 2006 06:22:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/240/applescript-shell#comment-35661</guid>
		<description>Or you could use &lt;a href="http://gnufoo.org/contacts/" rel="nofollow"&gt;contacts&lt;/a&gt;, a command-line client to OS X's Address Book.

For scripting from the command line I prefer the Python scripting bridge &lt;a href="http://appscript.sourceforge.net/" rel="nofollow"&gt;appscript&lt;/a&gt;, which has a great contextual terminology browser (just use .help() on any object), in combination with the enhanced Python shell &lt;a href="http://ipython.scipy.org/moin/" rel="nofollow"&gt;IPython&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Or you could use <a href="http://gnufoo.org/contacts/" rel="nofollow">contacts</a>, a command-line client to OS X&#8217;s Address Book.</p>
<p>For scripting from the command line I prefer the Python scripting bridge <a href="http://appscript.sourceforge.net/" rel="nofollow">appscript</a>, which has a great contextual terminology browser (just use .help() on any object), in combination with the enhanced Python shell <a href="http://ipython.scipy.org/moin/" rel="nofollow">IPython</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Hosey</title>
		<link>http://www.red-sweater.com/blog/240/applescript-shell#comment-35595</link>
		<dc:creator>Peter Hosey</dc:creator>
		<pubDate>Wed, 20 Dec 2006 02:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.red-sweater.com/blog/240/applescript-shell#comment-35595</guid>
		<description>Sounds a bit like a Terminal-based version of &lt;a href="http://multisolar.com/software/CLImax/" rel="nofollow"&gt;CLImax&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>Sounds a bit like a Terminal-based version of <a href="http://multisolar.com/software/CLImax/" rel="nofollow">CLImax</a>.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.282 seconds -->
