<?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: Resize Your Windows Automatically for Different Resolutions</title>
	<atom:link href="http://blog.slaunchaman.com/2008/05/20/resize-your-windows-automatically-for-different-resolutions/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.slaunchaman.com/2008/05/20/resize-your-windows-automatically-for-different-resolutions/</link>
	<description>Mac tips, iPhone applications, and the like</description>
	<lastBuildDate>Fri, 26 Feb 2010 06:14:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Stephan Ritter</title>
		<link>http://blog.slaunchaman.com/2008/05/20/resize-your-windows-automatically-for-different-resolutions/comment-page-1/#comment-628</link>
		<dc:creator>Stephan Ritter</dc:creator>
		<pubDate>Wed, 15 Jul 2009 22:07:30 +0000</pubDate>
		<guid isPermaLink="false">http://slaunchaman.wordpress.com/?p=17#comment-628</guid>
		<description>Hi Jeff,

Thanks for your post. I wrote a post on my new blog with a slightly different approach. The idea is that you can resize the currently active window to one of several sizes using different keyboard shortcuts. &lt;a href=&quot;http://www.thepretzelblog.com/2009/07/resize-windows-in-mac-os-x-from-the-keyboard-using-applescript/&quot; rel=&quot;nofollow&quot;&gt;Here is a link to that post&lt;/a&gt;.

Stephan

PS sorry about the domain name change. The previous comment (from the trackback) has the wrong address.</description>
		<content:encoded><![CDATA[<p>Hi Jeff,</p>
<p>Thanks for your post. I wrote a post on my new blog with a slightly different approach. The idea is that you can resize the currently active window to one of several sizes using different keyboard shortcuts. <a href="http://www.thepretzelblog.com/2009/07/resize-windows-in-mac-os-x-from-the-keyboard-using-applescript/" rel="nofollow">Here is a link to that post</a>.</p>
<p>Stephan</p>
<p>PS sorry about the domain name change. The previous comment (from the trackback) has the wrong address.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Pretzel Blog &#124; Just another WordPress weblog</title>
		<link>http://blog.slaunchaman.com/2008/05/20/resize-your-windows-automatically-for-different-resolutions/comment-page-1/#comment-627</link>
		<dc:creator>The Pretzel Blog &#124; Just another WordPress weblog</dc:creator>
		<pubDate>Wed, 15 Jul 2009 21:52:01 +0000</pubDate>
		<guid isPermaLink="false">http://slaunchaman.wordpress.com/?p=17#comment-627</guid>
		<description>[...] Jeff Kelley’s Blog post &#8220;Resize Your Windows Automatically for Different Resolutions&#8221;. See also this [...]</description>
		<content:encoded><![CDATA[<p>[...] Jeff Kelley’s Blog post &#8220;Resize Your Windows Automatically for Different Resolutions&#8221;. See also this [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Resize Windows in Mac OS X from the Keyboard Using AppleScript &#171; The Pretzel Blog</title>
		<link>http://blog.slaunchaman.com/2008/05/20/resize-your-windows-automatically-for-different-resolutions/comment-page-1/#comment-625</link>
		<dc:creator>Resize Windows in Mac OS X from the Keyboard Using AppleScript &#171; The Pretzel Blog</dc:creator>
		<pubDate>Tue, 14 Jul 2009 21:08:43 +0000</pubDate>
		<guid isPermaLink="false">http://slaunchaman.wordpress.com/?p=17#comment-625</guid>
		<description>[...] Jeff Kelley’s Blog post &#8220;Resize Your Windows Automatically for Different Resolutions&#8221;. See also this [...]</description>
		<content:encoded><![CDATA[<p>[...] Jeff Kelley’s Blog post &#8220;Resize Your Windows Automatically for Different Resolutions&#8221;. See also this [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: paulskinner</title>
		<link>http://blog.slaunchaman.com/2008/05/20/resize-your-windows-automatically-for-different-resolutions/comment-page-1/#comment-535</link>
		<dc:creator>paulskinner</dc:creator>
		<pubDate>Thu, 29 Jan 2009 15:25:08 +0000</pubDate>
		<guid isPermaLink="false">http://slaunchaman.wordpress.com/?p=17#comment-535</guid>
		<description>Jeff,

  Re: correctly returning values when multiple monitors are connected and updating immediately after screen resolution change.


This handler works on multiple monitors and returns correct dimensions immediately after a screen resize. Originally tested to return correct results immediately after second screen connection or disconnection, but I can&#039;t reconfirm that currently. The monitorProperties() handler below returns the count of connected monitors and the dimensions of each. It currently is coded to handle only two monitors due to my laptops connection options.



--Test results
set MonitorProps to monitorProperties()
--{monitor1:{Width:1440, Height:900, OriginX:0, OriginY:0}, monitor2:{Width:missing value, Height:missing value, OriginX:missing value, OriginY:missing value}, monitorCount:1}
set {monHeight, MonWidth} to {Height of monitor1, Width of monitor1} of MonitorProps
--{900,1440}





on monitorProperties()
	--paulskinner Friday, March 14, 2008 6:11:53 PM
	--system_profiler parsing
	set SPDisplaysData to (do shell script &quot;system_profiler SPDisplaysDataType&quot;)
	set text item delimiters to &quot;Displays:&quot;
	set SPDisplaysData to text item 3 of SPDisplaysData
	set text item delimiters to (word 1 of SPDisplaysData)
	copy text item 1 of SPDisplaysData to text item delimiters
	set SPDisplaysData to text items 2 thru -1 of SPDisplaysData
	set text item delimiters to &quot;&quot;
	repeat with i from 2 to length of SPDisplaysData
		if character 1 of item i of SPDisplaysData is not &quot; &quot; then
			set monitor1 to items 2 thru (i - 1) of SPDisplaysData
			set monitor2 to items (i + 1) thru -1 of SPDisplaysData
			exit repeat
		end if
	end repeat
	--END OF system_profiler parsing
	
	set {monitorCount, output} to {1, {}}
	repeat with curList in {monitor1, monitor2}
		set mainDisplay to false
		curList
		if item 1 of curList contains &quot;Status: No display connected&quot; then
			return {monitor1:{Width:y as integer, Height:x as integer, OriginX:0, OriginY:0}, monitor2:{Width:missing value, Height:missing value, OriginX:missing value, OriginY:missing value}, monitorCount:monitorCount}
		else
			repeat with i from 1 to length of curList
				set curItem to item i of curList
				if curItem contains &quot;Resolution:&quot; then
					set {y, x} to {word 2 of curItem, word 4 of curItem}
				end if
				if curItem contains &quot;Main Display: Yes&quot; then
					set mainDisplay to true
				end if
			end repeat
		end if
		if mainDisplay then
			set display1 to {Width:y as integer, Height:x as integer, OriginX:missing value, OriginY:missing value}
		else
			set monitorCount to 2
			set display2 to {Width:y as integer, Height:x as integer, OriginX:missing value, OriginY:missing value}
		end if
	end repeat
	
	-- If there are two monitors then use com.apple.windowserver to try to acquire Origins
	set {monitor1, monitor2} to {{}, {Height:missing value, Width:missing value, OriginX:missing value, OriginY:missing value}}
	set PrefFilePath to do shell script &quot;find &quot; &amp; (POSIX path of ((path to preferences from user domain as Unicode text) &amp; &quot;ByHost:&quot;)) &amp; &quot; -name &#039;com.apple.windowserver*&#039;&quot;
	tell application &quot;System Events&quot;
		set wsp to item 1 of (item 1 of (get value of property list items of property list file PrefFilePath))
	end tell
	repeat with mon from 1 to length of wsp
		set monData to item mon of wsp
		if (&#124;OriginX&#124; of monData is 0) and (&#124;OriginY&#124; of monData is 0) then
			set monitor1 to {Height:&#124;Height&#124; of monData, Width:&#124;Width&#124; of monData, OriginX:&#124;OriginX&#124; of monData, OriginY:&#124;OriginY&#124; of monData}
		else
			set monitor2 to {Height:&#124;Height&#124; of monData, Width:&#124;Width&#124; of monData, OriginX:&#124;OriginX&#124; of monData, OriginY:&#124;OriginY&#124; of monData}
		end if
	end repeat
	set WSmp to {monitor1:monitor1, monitor2:monitor2, monitorCount:(length of wsp) as integer}
	--END OF If there are two monitors then use com.apple.windowserver to try to acquire Origins
	
	if monitorCount is monitorCount of WSmp then --If monitor count matches, compare dimensions reported by the two sources.
		if (Height of display1 is (Height of monitor1 of WSmp)) and (Width of display1 is (Width of monitor1 of WSmp)) and (Height of display2 is (Height of monitor2 of WSmp)) and (Width of display2 is (Width of monitor2 of WSmp)) then
			return WSmp -- All match, return windowserver data since it is most complete.
		end if
	end if
	return {monitor1:display1, monitor2:display2, monitorCount:monitorCount} -- Not all match, return system_profiler data.
end monitorProperties</description>
		<content:encoded><![CDATA[<p>Jeff,</p>
<p>  Re: correctly returning values when multiple monitors are connected and updating immediately after screen resolution change.</p>
<p>This handler works on multiple monitors and returns correct dimensions immediately after a screen resize. Originally tested to return correct results immediately after second screen connection or disconnection, but I can&#8217;t reconfirm that currently. The monitorProperties() handler below returns the count of connected monitors and the dimensions of each. It currently is coded to handle only two monitors due to my laptops connection options.</p>
<p>&#8211;Test results<br />
set MonitorProps to monitorProperties()<br />
&#8211;{monitor1:{Width:1440, Height:900, OriginX:0, OriginY:0}, monitor2:{Width:missing value, Height:missing value, OriginX:missing value, OriginY:missing value}, monitorCount:1}<br />
set {monHeight, MonWidth} to {Height of monitor1, Width of monitor1} of MonitorProps<br />
&#8211;{900,1440}</p>
<p>on monitorProperties()<br />
	&#8211;paulskinner Friday, March 14, 2008 6:11:53 PM<br />
	&#8211;system_profiler parsing<br />
	set SPDisplaysData to (do shell script &#8220;system_profiler SPDisplaysDataType&#8221;)<br />
	set text item delimiters to &#8220;Displays:&#8221;<br />
	set SPDisplaysData to text item 3 of SPDisplaysData<br />
	set text item delimiters to (word 1 of SPDisplaysData)<br />
	copy text item 1 of SPDisplaysData to text item delimiters<br />
	set SPDisplaysData to text items 2 thru -1 of SPDisplaysData<br />
	set text item delimiters to &#8220;&#8221;<br />
	repeat with i from 2 to length of SPDisplaysData<br />
		if character 1 of item i of SPDisplaysData is not &#8221; &#8221; then<br />
			set monitor1 to items 2 thru (i &#8211; 1) of SPDisplaysData<br />
			set monitor2 to items (i + 1) thru -1 of SPDisplaysData<br />
			exit repeat<br />
		end if<br />
	end repeat<br />
	&#8211;END OF system_profiler parsing</p>
<p>	set {monitorCount, output} to {1, {}}<br />
	repeat with curList in {monitor1, monitor2}<br />
		set mainDisplay to false<br />
		curList<br />
		if item 1 of curList contains &#8220;Status: No display connected&#8221; then<br />
			return {monitor1:{Width:y as integer, Height:x as integer, OriginX:0, OriginY:0}, monitor2:{Width:missing value, Height:missing value, OriginX:missing value, OriginY:missing value}, monitorCount:monitorCount}<br />
		else<br />
			repeat with i from 1 to length of curList<br />
				set curItem to item i of curList<br />
				if curItem contains &#8220;Resolution:&#8221; then<br />
					set {y, x} to {word 2 of curItem, word 4 of curItem}<br />
				end if<br />
				if curItem contains &#8220;Main Display: Yes&#8221; then<br />
					set mainDisplay to true<br />
				end if<br />
			end repeat<br />
		end if<br />
		if mainDisplay then<br />
			set display1 to {Width:y as integer, Height:x as integer, OriginX:missing value, OriginY:missing value}<br />
		else<br />
			set monitorCount to 2<br />
			set display2 to {Width:y as integer, Height:x as integer, OriginX:missing value, OriginY:missing value}<br />
		end if<br />
	end repeat</p>
<p>	&#8211; If there are two monitors then use com.apple.windowserver to try to acquire Origins<br />
	set {monitor1, monitor2} to {{}, {Height:missing value, Width:missing value, OriginX:missing value, OriginY:missing value}}<br />
	set PrefFilePath to do shell script &#8220;find &#8221; &amp; (POSIX path of ((path to preferences from user domain as Unicode text) &amp; &#8220;ByHost:&#8221;)) &amp; &#8221; -name &#8216;com.apple.windowserver*&#8217;&#8221;<br />
	tell application &#8220;System Events&#8221;<br />
		set wsp to item 1 of (item 1 of (get value of property list items of property list file PrefFilePath))<br />
	end tell<br />
	repeat with mon from 1 to length of wsp<br />
		set monData to item mon of wsp<br />
		if (|OriginX| of monData is 0) and (|OriginY| of monData is 0) then<br />
			set monitor1 to {Height:|Height| of monData, Width:|Width| of monData, OriginX:|OriginX| of monData, OriginY:|OriginY| of monData}<br />
		else<br />
			set monitor2 to {Height:|Height| of monData, Width:|Width| of monData, OriginX:|OriginX| of monData, OriginY:|OriginY| of monData}<br />
		end if<br />
	end repeat<br />
	set WSmp to {monitor1:monitor1, monitor2:monitor2, monitorCount:(length of wsp) as integer}<br />
	&#8211;END OF If there are two monitors then use com.apple.windowserver to try to acquire Origins</p>
<p>	if monitorCount is monitorCount of WSmp then &#8211;If monitor count matches, compare dimensions reported by the two sources.<br />
		if (Height of display1 is (Height of monitor1 of WSmp)) and (Width of display1 is (Width of monitor1 of WSmp)) and (Height of display2 is (Height of monitor2 of WSmp)) and (Width of display2 is (Width of monitor2 of WSmp)) then<br />
			return WSmp &#8212; All match, return windowserver data since it is most complete.<br />
		end if<br />
	end if<br />
	return {monitor1:display1, monitor2:display2, monitorCount:monitorCount} &#8212; Not all match, return system_profiler data.<br />
end monitorProperties</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Resizing Windows in Mac &#124; MacPhobia</title>
		<link>http://blog.slaunchaman.com/2008/05/20/resize-your-windows-automatically-for-different-resolutions/comment-page-1/#comment-512</link>
		<dc:creator>Resizing Windows in Mac &#124; MacPhobia</dc:creator>
		<pubDate>Fri, 09 Jan 2009 07:01:47 +0000</pubDate>
		<guid isPermaLink="false">http://slaunchaman.wordpress.com/?p=17#comment-512</guid>
		<description>[...] irritating if you use multiple monitors which have different resolutions.  Jeff has created an AppleScript which solves the problem and resizes window to fit the monitor resolution for some of the [...]</description>
		<content:encoded><![CDATA[<p>[...] irritating if you use multiple monitors which have different resolutions.  Jeff has created an AppleScript which solves the problem and resizes window to fit the monitor resolution for some of the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Kelley’s Blog &#187; Blog Archive &#187; Updated: Resizer AppleScript</title>
		<link>http://blog.slaunchaman.com/2008/05/20/resize-your-windows-automatically-for-different-resolutions/comment-page-1/#comment-62</link>
		<dc:creator>Jeff Kelley’s Blog &#187; Blog Archive &#187; Updated: Resizer AppleScript</dc:creator>
		<pubDate>Sat, 12 Jul 2008 12:41:09 +0000</pubDate>
		<guid isPermaLink="false">http://slaunchaman.wordpress.com/?p=17#comment-62</guid>
		<description>[...] looking at my AppleScript to resize windows, I’ve decided to make a few updates.  Instead of manually doing the math for each resolution, [...]</description>
		<content:encoded><![CDATA[<p>[...] looking at my AppleScript to resize windows, I’ve decided to make a few updates.  Instead of manually doing the math for each resolution, [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Kelley’s Blog &#187; Blog Archive &#187; Use Your MacBook Pro with an External Monitor Without Sleeping</title>
		<link>http://blog.slaunchaman.com/2008/05/20/resize-your-windows-automatically-for-different-resolutions/comment-page-1/#comment-45</link>
		<dc:creator>Jeff Kelley’s Blog &#187; Blog Archive &#187; Use Your MacBook Pro with an External Monitor Without Sleeping</dc:creator>
		<pubDate>Thu, 10 Jul 2008 04:16:14 +0000</pubDate>
		<guid isPermaLink="false">http://slaunchaman.wordpress.com/?p=17#comment-45</guid>
		<description>[...] in a similar vein as to what pushed me to write my Applescript to resize windows, I’ve been looking at what to do about going from using the LCD on the MacBook pro to an external [...]</description>
		<content:encoded><![CDATA[<p>[...] in a similar vein as to what pushed me to write my Applescript to resize windows, I’ve been looking at what to do about going from using the LCD on the MacBook pro to an external [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: How to get the dimensions of the dock with AppleScript in Mac OS X Leopard at j4mie dot org</title>
		<link>http://blog.slaunchaman.com/2008/05/20/resize-your-windows-automatically-for-different-resolutions/comment-page-1/#comment-27</link>
		<dc:creator>How to get the dimensions of the dock with AppleScript in Mac OS X Leopard at j4mie dot org</dc:creator>
		<pubDate>Mon, 26 May 2008 16:17:53 +0000</pubDate>
		<guid isPermaLink="false">http://slaunchaman.wordpress.com/?p=17#comment-27</guid>
		<description>[...] code snipped might be useful for anyone wanting to write a script to resize your application windows automatically to fit on your [...]</description>
		<content:encoded><![CDATA[<p>[...] code snipped might be useful for anyone wanting to write a script to resize your application windows automatically to fit on your [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PowerLlama</title>
		<link>http://blog.slaunchaman.com/2008/05/20/resize-your-windows-automatically-for-different-resolutions/comment-page-1/#comment-24</link>
		<dc:creator>PowerLlama</dc:creator>
		<pubDate>Mon, 26 May 2008 02:43:48 +0000</pubDate>
		<guid isPermaLink="false">http://slaunchaman.wordpress.com/?p=17#comment-24</guid>
		<description>Thanks Jeff!

I know pretty much nothing about applescript, or coding. =(

I think I can work it out though.</description>
		<content:encoded><![CDATA[<p>Thanks Jeff!</p>
<p>I know pretty much nothing about applescript, or coding. =(</p>
<p>I think I can work it out though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Kelley</title>
		<link>http://blog.slaunchaman.com/2008/05/20/resize-your-windows-automatically-for-different-resolutions/comment-page-1/#comment-23</link>
		<dc:creator>Jeff Kelley</dc:creator>
		<pubDate>Mon, 26 May 2008 02:02:11 +0000</pubDate>
		<guid isPermaLink="false">http://slaunchaman.wordpress.com/?p=17#comment-23</guid>
		<description>PowerLlama,

There’s no reason you can’t; my script uses variables like _nl and _nr, you could use _new_firefox_left and _new_mail_left, etc.  Go nuts.</description>
		<content:encoded><![CDATA[<p>PowerLlama,</p>
<p>There’s no reason you can’t; my script uses variables like _nl and _nr, you could use _new_firefox_left and _new_mail_left, etc.  Go nuts.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
