<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Create An AppleScript From the Frontmost Application &#8211; Using AppleScript</title>
	<atom:link href="http://macmembrane.com/create-an-applescript-from-current-application-using-applescript/feed/" rel="self" type="application/rss+xml" />
	<link>http://macmembrane.com/create-an-applescript-from-current-application-using-applescript/</link>
	<description>There are peels everywhere...</description>
	<lastBuildDate>Wed, 02 Nov 2011 20:57:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: makojad</title>
		<link>http://macmembrane.com/create-an-applescript-from-current-application-using-applescript/comment-page-1/#comment-313</link>
		<dc:creator>makojad</dc:creator>
		<pubDate>Sun, 18 Jan 2009 17:40:28 +0000</pubDate>
		<guid isPermaLink="false">http://macmembrane.com/?p=306#comment-313</guid>
		<description>Hi, looking at your script I thought it could be simplified. So I made a revision of yours and came with a script that does exactly the same thing but the syntax is simpler, that is:

--this only will get the name of the front application for us:
tell application &quot;System Events&quot; to set frontApp to name of first process whose frontmost is true

tell application &quot;Script Editor&quot;
	--might as well go here:
	activate
	set a to make new document
	--in case Script Editor has already one or several documents opened:
	set a to the frontmost
	--simple and straightforward:
	set contents of document a to &quot;tell application \&quot;&quot; &amp; frontApp &amp; &quot;\&quot;&quot; &amp; return &amp; return &amp; &quot;end tell&quot;
	try
		compile document a
	end try
end tell
--and that&#039;s it :), it should return true
--best of luck!

Regards,</description>
		<content:encoded><![CDATA[<p>Hi, looking at your script I thought it could be simplified. So I made a revision of yours and came with a script that does exactly the same thing but the syntax is simpler, that is:</p>
<p>&#8211;this only will get the name of the front application for us:<br />
tell application &#8220;System Events&#8221; to set frontApp to name of first process whose frontmost is true</p>
<p>tell application &#8220;Script Editor&#8221;<br />
	&#8211;might as well go here:<br />
	activate<br />
	set a to make new document<br />
	&#8211;in case Script Editor has already one or several documents opened:<br />
	set a to the frontmost<br />
	&#8211;simple and straightforward:<br />
	set contents of document a to &#8220;tell application \&#8221;" &amp; frontApp &amp; &#8220;\&#8221;" &amp; return &amp; return &amp; &#8220;end tell&#8221;<br />
	try<br />
		compile document a<br />
	end try<br />
end tell<br />
&#8211;and that&#8217;s it :), it should return true<br />
&#8211;best of luck!</p>
<p>Regards,</p>
]]></content:encoded>
	</item>
</channel>
</rss>

