Jump to content

pop alfred with keyword filled with applescript?


Recommended Posts

I'm pretty sure this can be done right? I'm horrible with applescript :D

I know I can do this with a hotkey only, show alfred + text, but I want applescript to check on the current context, basically I want to show alfred with ~ prefilled ONLY if the frontmost window is a Finder window.

 

Thanks!

Link to comment
tell application "System Events"
	set activeApp to item 1 of (get name of processes whose frontmost is true)
	if activeApp = "Finder" then
		tell application "Alfred 2" to search "~"
	end if
end tell

 

Try that and let me know if it meets your needs.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...