<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: quicksilver code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sun, 07 Sep 2008 05:37:11 GMT</pubDate>
    <description>DZone Snippets: quicksilver code</description>
    <item>
      <title>Quick search with Quicksilver and EasyFind</title>
      <link>http://snippets.dzone.com/posts/show/1077</link>
      <description>// A script to quickly search files and folders using Quicksilver and EasyFind.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;(*&lt;br /&gt;A script to quickly search files and folders using Quicksilver [1] and EasyFind [2].&lt;br /&gt;Written by Simon Dorfman, January 8, 2006. www.SimonDorfman.com&lt;br /&gt;&lt;br /&gt;Save this script to ~/Library/Application Support/Quicksilver/Actions/EasyFind.scpt&lt;br /&gt;You'll need to have "Enable access for assisstive devices" enabled under Universal Access in System Preferences.&lt;br /&gt;To use:&lt;br /&gt;	1. activate Quicksilver&lt;br /&gt;	2. type "." (i.e. hit the period key)&lt;br /&gt;	3. type the text you want to search for (i.e. httpd.conf)&lt;br /&gt;	4. press tab&lt;br /&gt;	5. start typing "EasyFind.scpt"&lt;br /&gt;	6. once Quicksilver finds "EasyFind.scpt", press return&lt;br /&gt;	&lt;br /&gt;[1] http://www.versiontracker.com/dyn/moreinfo/macosx/22549&lt;br /&gt;[2] http://www.versiontracker.com/dyn/moreinfo/macosx/11706&lt;br /&gt;*)&lt;br /&gt;&lt;br /&gt;using terms from application "Quicksilver"&lt;br /&gt;	on process text t&lt;br /&gt;		tell application "EasyFind" to activate&lt;br /&gt;		tell application "System Events"&lt;br /&gt;			tell process "EasyFind"&lt;br /&gt;				set value of text field 1 of window 1 to t --type text in search field&lt;br /&gt;				--uncomment your preferred search option, or save separate scripts with each option&lt;br /&gt;				click radio button 1 of radio group 1 of window 1 --"Files &amp; Folders"&lt;br /&gt;				--click radio button 2 of radio group 1 of window 1 --"Only Files"&lt;br /&gt;				--click radio button 3 of radio group 1 of window 1 --"Only Folders"&lt;br /&gt;				--click radio button 4 of radio group 1 of window 1 --"File Contents"&lt;br /&gt;				click button 4 of window 1 --start search&lt;br /&gt;			end tell&lt;br /&gt;		end tell&lt;br /&gt;	end process text&lt;br /&gt;end using terms from&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sun, 08 Jan 2006 19:00:45 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1077</guid>
      <author>SimonDorfman (Simon Dorfman)</author>
    </item>
    <item>
      <title>Resize Front Two Windows Side by Side, Filling Screen</title>
      <link>http://snippets.dzone.com/posts/show/1067</link>
      <description>// An applescript that resizes the front two windows of the active application side by side, filling the screen.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;-- An applescript that resizes the front two windows of the active application side by side, filling the screen.&lt;br /&gt;-- Written by Simon Dorfman, January 4, 2006. www.SimonDorfman.com&lt;br /&gt;&lt;br /&gt;-- Save this script to ~/Library/Scripts/Applications/Run from QuickSilver Triggers, Don't move these/Front 2 Windows Side by Side - Control + Option + C.scpt&lt;br /&gt;-- I use keyboard shortcut Control + Option + C to run it.  I think of the C as standing for "Compare".&lt;br /&gt;-- You'll need to have "Enable access for assisstive devices" enabled under Universal Access in System Preferences.&lt;br /&gt;&lt;br /&gt;--set screen dimension variables&lt;br /&gt;set menubarHeight to 22&lt;br /&gt;set screenWidth to word 3 of (do shell script "defaults read /Library/Preferences/com.apple.windowserver | grep -w Width") as number&lt;br /&gt;set screenHeight to word 3 of (do shell script "defaults read /Library/Preferences/com.apple.windowserver | grep -w Height") as number&lt;br /&gt;--if you plan to use this on just one computer where the screen dimensions won't change, this script will run faster if you just hard code your screen resolution with these two lines:&lt;br /&gt;--set screenWidth to 1280&lt;br /&gt;--set screenHeight to 854&lt;br /&gt;{screenWidth, screenHeight}&lt;br /&gt;&lt;br /&gt;tell application "System Events"&lt;br /&gt;	set frontApp to name of first application process whose frontmost is true&lt;br /&gt;end tell&lt;br /&gt;&lt;br /&gt;--some apps are wacky and put the windows higher for some reason, adjust for this bug.&lt;br /&gt;if (frontApp is equal to "Finder" or frontApp is equal to "Microsoft Entourage") then&lt;br /&gt;	set menubarHeight to 44&lt;br /&gt;end if&lt;br /&gt;--leave room for the Excel Toolbar&lt;br /&gt;if (frontApp is equal to "Microsoft Excel") then&lt;br /&gt;	set menubarHeight to 55&lt;br /&gt;end if&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;	tell application frontApp&lt;br /&gt;		set bounds of window 1 to {0, menubarHeight, (screenWidth / 2), screenHeight}&lt;br /&gt;		set bounds of window 2 to {(screenWidth / 2), menubarHeight, screenWidth, screenHeight}&lt;br /&gt;	end tell&lt;br /&gt;on error the error_message number the error_number&lt;br /&gt;	display dialog "Error: " &amp; the error_number &amp; ". " &amp; the error_message buttons {"OK"} default button 1&lt;br /&gt;end try&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 05 Jan 2006 16:15:34 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1067</guid>
      <author>SimonDorfman (Simon Dorfman)</author>
    </item>
    <item>
      <title>Keyboard shortcut for the green "zoom" button</title>
      <link>http://snippets.dzone.com/posts/show/1026</link>
      <description>// Ever since I started using OS X as my main OS (back at version 10.1), I kept wishing for a keyboard shortcut for the green button at the top left of each window.  I wanted a quick way to maximize a window.  Sadly, such a shortcut never came into being.  I finally took the time to write an applescript to do the job. You can paste this script into Script Editor and save it in your ~/Library/Scripts/ folder.  I saved my script as "Click Green Maximize Button of Frontmost Window.scpt". I then used QuickSilver's Triggers feature to assign the keyboard shortcut Control-Option-Z to run the script. I picked that key combination because it's easy to press. I remember it by thinking of the Z as standing for Zoom. Get QuickSilver here: http://www.versiontracker.com/dyn/moreinfo/macosx/22549&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;tell application "System Events"&lt;br /&gt;	if UI elements enabled then&lt;br /&gt;		set FrontApplication to (get name of every process whose frontmost is true) as string&lt;br /&gt;		tell process FrontApplication&lt;br /&gt;			click button 2 of window 1&lt;br /&gt;			--button 2 is the green "zoom" button for all applications&lt;br /&gt;			--window 1 is always the frontmost window.&lt;br /&gt;		end tell&lt;br /&gt;	else&lt;br /&gt;		tell application "System Preferences"&lt;br /&gt;			activate&lt;br /&gt;			set current pane to pane "com.apple.preference.universalaccess"&lt;br /&gt;			display dialog "UI element scripting is not enabled. Check 'Enable access for assistive devices'"&lt;br /&gt;		end tell&lt;br /&gt;	end if&lt;br /&gt;end tell&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 28 Dec 2005 09:57:57 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1026</guid>
      <author>SimonDorfman (Simon Dorfman)</author>
    </item>
  </channel>
</rss>
