
<?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: Centering Windows in Mac OS X with AppleScript</title>
	<atom:link href="http://incrementalism.net/tech/centering-windows-in-mac-os-x-with-applescript/feed" rel="self" type="application/rss+xml" />
	<link>http://incrementalism.net/tech/centering-windows-in-mac-os-x-with-applescript</link>
	<description></description>
	<lastBuildDate>Mon, 19 Jul 2010 03:27:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Tim Moore</title>
		<link>http://incrementalism.net/tech/centering-windows-in-mac-os-x-with-applescript/comment-page-1#comment-15511</link>
		<dc:creator>Tim Moore</dc:creator>
		<pubDate>Mon, 19 Jul 2010 03:27:53 +0000</pubDate>
		<guid isPermaLink="false">http://incrementalism.net/?p=124#comment-15511</guid>
		<description>Russ,

Normally it should work with whatever window is frontmost, but I can&#039;t guarantee it will work properly in every application, because it depends on their support for AppleScript. I unfortunately don&#039;t have a copy of Microsoft Word to test with, but if anyone has a solution, please let me know and I&#039;ll update the post.</description>
		<content:encoded><![CDATA[<p>Russ,</p>
<p>Normally it should work with whatever window is frontmost, but I can&#8217;t guarantee it will work properly in every application, because it depends on their support for AppleScript. I unfortunately don&#8217;t have a copy of Microsoft Word to test with, but if anyone has a solution, please let me know and I&#8217;ll update the post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Russ</title>
		<link>http://incrementalism.net/tech/centering-windows-in-mac-os-x-with-applescript/comment-page-1#comment-15294</link>
		<dc:creator>Russ</dc:creator>
		<pubDate>Tue, 13 Jul 2010 12:44:12 +0000</pubDate>
		<guid isPermaLink="false">http://incrementalism.net/?p=124#comment-15294</guid>
		<description>I love this script, but I&#039;m new to Macs, and a total noob with scripts, so bear with me...

If you have, for example, two Word documents open, the script will only apply itself to the document that was initially opened. You can&#039;t toggle between windows and apply the script to the second document.

Is there anyway to jig this script so that it will work with multiple windows of the same application after having switched to the second or subsequent document/window?</description>
		<content:encoded><![CDATA[<p>I love this script, but I&#8217;m new to Macs, and a total noob with scripts, so bear with me&#8230;</p>
<p>If you have, for example, two Word documents open, the script will only apply itself to the document that was initially opened. You can&#8217;t toggle between windows and apply the script to the second document.</p>
<p>Is there anyway to jig this script so that it will work with multiple windows of the same application after having switched to the second or subsequent document/window?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://incrementalism.net/tech/centering-windows-in-mac-os-x-with-applescript/comment-page-1#comment-12034</link>
		<dc:creator>James</dc:creator>
		<pubDate>Sat, 17 Apr 2010 14:00:41 +0000</pubDate>
		<guid isPermaLink="false">http://incrementalism.net/?p=124#comment-12034</guid>
		<description>Hey there,
good post, extremely useful!
Also check out this page for handy scripts http://www.giacomoballi.com/scripts.html
By the way, Tim, i was just about to point that out...
Good job guys!</description>
		<content:encoded><![CDATA[<p>Hey there,<br />
good post, extremely useful!<br />
Also check out this page for handy scripts <a href="http://www.giacomoballi.com/scripts.html" rel="nofollow">http://www.giacomoballi.com/scripts.html</a><br />
By the way, Tim, i was just about to point that out&#8230;<br />
Good job guys!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stakker</title>
		<link>http://incrementalism.net/tech/centering-windows-in-mac-os-x-with-applescript/comment-page-1#comment-6845</link>
		<dc:creator>Stakker</dc:creator>
		<pubDate>Sun, 22 Nov 2009 19:41:59 +0000</pubDate>
		<guid isPermaLink="false">http://incrementalism.net/?p=124#comment-6845</guid>
		<description>Well, that did the trick!

Gotta love AppleScript syntax :-)

Thank you for bothering to help. My life is in order again! ;-)</description>
		<content:encoded><![CDATA[<p>Well, that did the trick!</p>
<p>Gotta love AppleScript syntax <img src='http://incrementalism.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Thank you for bothering to help. My life is in order again! <img src='http://incrementalism.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Moore</title>
		<link>http://incrementalism.net/tech/centering-windows-in-mac-os-x-with-applescript/comment-page-1#comment-6805</link>
		<dc:creator>Tim Moore</dc:creator>
		<pubDate>Sat, 21 Nov 2009 03:30:03 +0000</pubDate>
		<guid isPermaLink="false">http://incrementalism.net/?p=124#comment-6805</guid>
		<description>Good catch, Stakker,

That&#039;s because windows with an odd-numbered pixel-width can&#039;t be perfectly centered on a screen with an even number of pixels. Fractional pixel values get rounded automatically.

If you want more control over the rounding, you can change this part:

[applescript classname=&quot;applescript&quot;]
    set bounds of window 1 to {¬
        (screenWidth - windowWidth) / 2.0, ¬
        windowYt, ¬
        (screenWidth + windowWidth) / 2.0, ¬
        windowYb}
[/applescript]

to something like this:

[applescript classname=&quot;applescript&quot;]
    set bounds of window 1 to {¬
        round ((screenWidth - windowWidth) / 2) rounding as taught in school, ¬
        windowYt, ¬
        round ((screenWidth + windowWidth) / 2) rounding as taught in school, ¬
        windowYb}
[/applescript]

It&#039;s kind of wordy, but it tells AppleScript to always round .5 up. Normally, it rounds .5 towards the nearest even number.

You can see full documentation for the different rounding options in the &lt;a href=&quot;http://docs.info.apple.com/article.html?path=AppleScript/2.1/en/as212.html&quot; rel=&quot;nofollow&quot;&gt;AppleScript 2.1 Help: round&lt;/a&gt; document on Apple&#039;s site.</description>
		<content:encoded><![CDATA[<p>Good catch, Stakker,</p>
<p>That&#8217;s because windows with an odd-numbered pixel-width can&#8217;t be perfectly centered on a screen with an even number of pixels. Fractional pixel values get rounded automatically.</p>
<p>If you want more control over the rounding, you can change this part:</p>
<pre class="brush: applescript; class-name: applescript;">
    set bounds of window 1 to {¬
        (screenWidth - windowWidth) / 2.0, ¬
        windowYt, ¬
        (screenWidth + windowWidth) / 2.0, ¬
        windowYb}
</pre>
<p>to something like this:</p>
<pre class="brush: applescript; class-name: applescript;">
    set bounds of window 1 to {¬
        round ((screenWidth - windowWidth) / 2) rounding as taught in school, ¬
        windowYt, ¬
        round ((screenWidth + windowWidth) / 2) rounding as taught in school, ¬
        windowYb}
</pre>
<p>It&#8217;s kind of wordy, but it tells AppleScript to always round .5 up. Normally, it rounds .5 towards the nearest even number.</p>
<p>You can see full documentation for the different rounding options in the <a href="http://docs.info.apple.com/article.html?path=AppleScript/2.1/en/as212.html" rel="nofollow">AppleScript 2.1 Help: round</a> document on Apple&#8217;s site.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stakker</title>
		<link>http://incrementalism.net/tech/centering-windows-in-mac-os-x-with-applescript/comment-page-1#comment-6507</link>
		<dc:creator>Stakker</dc:creator>
		<pubDate>Mon, 09 Nov 2009 13:47:59 +0000</pubDate>
		<guid isPermaLink="false">http://incrementalism.net/?p=124#comment-6507</guid>
		<description>Very cool, cheers! (I share the same alignment &quot;problem&quot; :-)
I use Spark to launch the script with a keyboard shortcut myself.

However, the script can actually change the horizontal window size by one pixel.

This is noticeable with Pages if you size the window so that it&#039;s exactly the width of the page (horizontal scroll bar disappears but no background gray appears yet). The script can sometimes make the window 1 pixel wider or narrower depending on the width of the window. Perhaps something to do with odd/even numbers?

Yes, one pixel. But we&#039;re already in freaky obsession territory here! :-) (In pages the one pixel is very noticeable since it makes an ugly dark line appear into the margin, instead of smooth white.)</description>
		<content:encoded><![CDATA[<p>Very cool, cheers! (I share the same alignment &#8220;problem&#8221; <img src='http://incrementalism.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
I use Spark to launch the script with a keyboard shortcut myself.</p>
<p>However, the script can actually change the horizontal window size by one pixel.</p>
<p>This is noticeable with Pages if you size the window so that it&#8217;s exactly the width of the page (horizontal scroll bar disappears but no background gray appears yet). The script can sometimes make the window 1 pixel wider or narrower depending on the width of the window. Perhaps something to do with odd/even numbers?</p>
<p>Yes, one pixel. But we&#8217;re already in freaky obsession territory here! <img src='http://incrementalism.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  (In pages the one pixel is very noticeable since it makes an ugly dark line appear into the margin, instead of smooth white.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Moore</title>
		<link>http://incrementalism.net/tech/centering-windows-in-mac-os-x-with-applescript/comment-page-1#comment-3419</link>
		<dc:creator>Tim Moore</dc:creator>
		<pubDate>Mon, 20 Jul 2009 07:37:36 +0000</pubDate>
		<guid isPermaLink="false">http://incrementalism.net/?p=124#comment-3419</guid>
		<description>I hadn&#039;t, but to be honest most of the features other than centering don&#039;t really appeal to me. This script works well enough for that.</description>
		<content:encoded><![CDATA[<p>I hadn&#8217;t, but to be honest most of the features other than centering don&#8217;t really appeal to me. This script works well enough for that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: metanoize</title>
		<link>http://incrementalism.net/tech/centering-windows-in-mac-os-x-with-applescript/comment-page-1#comment-3417</link>
		<dc:creator>metanoize</dc:creator>
		<pubDate>Mon, 20 Jul 2009 06:26:59 +0000</pubDate>
		<guid isPermaLink="false">http://incrementalism.net/?p=124#comment-3417</guid>
		<description>have you see SizeUp http://www.irradiatedsoftware.com/</description>
		<content:encoded><![CDATA[<p>have you see SizeUp <a href="http://www.irradiatedsoftware.com/" rel="nofollow">http://www.irradiatedsoftware.com/</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

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