Quick Open - System Wide Shortcut

@gtdwannabe I’m not an Alfred user, but I just adapted Shawn Blanc’s OopsieFocus script to instead activate OF’s Quick Open panel if the app is closed.

You can set a global shortcut with Fastscripts per my post above, but the key difference between OopsieFocus and this script is that you do not want to make the script’s shortcut the same as OF’s Quick Open shortcut because of a conflict: system-wide, the CMD-O shortcut opens a file in its native app.

Therefore, either use the default shortcut when OF is open, and another one for this script; or, edit the script to remove the check on whether OF is running, and just force Quick Open with a new shortcut.

-- This script allows the opening of OmniFocus and a Quick Open panel using the Quick Open keyboard shortcut in OF in the event OF is not open.
-- If OF is open, nothing happens.
-- Launch using a launcher app with a global keyboard shortcut.
-- This is based on the OopsieFocus script written by Shawn Blanc

on appIsRunning(Omnifocus)
	tell application "System Events"
		return (count of (application processes whose name is Omnifocus)) is not 0
	end tell
end appIsRunning

if appIsRunning("OmniFocus") then
	null
	
else
	tell application "System Events"
		activate application "OmniFocus"
		tell process "OmniFocus"
			click menu item "Quick Open…" of menu "File" of menu bar item "File" of menu bar 1
			set value of text field 1 of front window to ""
		end tell
	end tell
	tell application "OmniFocus" to activate the default document
end if

FWIW, you can do this with no scripting in Keyboard Maestro.

1 Like

In BetterTouchTool:

2 Likes

Goodness! I didn’t even know BTT could do that! There go a few minutes tinkering…

@derekr’s script didn’t quite work for me, but this slightly modified one does:

on handle_string(msg)
	tell application "System Events"
		tell process "OmniFocus"
			click menu item "Quick Open…" of menu "File" of menu bar item "File" of menu bar 1
			set value of text field 1 of front window to msg
		end tell
	end tell
	
end handle_string