Jump to content

Alfred Preferences Launcher


Recommended Posts

Posted (edited)

A simple workflow that uses a hotkey to launch the Alfred Preferences window using applescript. I modified some code that I found on the forums to improve the workflow. If the Alfred Preferences window is closed and the hotkey is pressed the preferences window will open. If the preferences window is already open then the focus will shift to that window, even if it's in a different space.

 

Download on Github

 

Under MIT license

Edited by dalimatt
Posted (edited)

You shouldn’t be automating keystrokes most of the time, but definitely not when there is an alternative. They may be dependent on the user’s configurations, and GUI scripting is a recipe for unpredictability and disaster. You also don’t need that much code; all of it can be replaced with a single line: tell application "Alfred Preferences" to activate (or activate application "Alfred Preferences"). In addition, a Run NSApplescript isn’t necessarily the best option for this, as you have no use for on alfred_script(q). You should likely be using a Run Script with /usr/bin/osascript.

 

Finally, you can’t release the whole workflow under the MIT license since you don’t own Alfred’s icon (that you are using). Not that Andrew or Vero mind you using the icon for this, probably, but still its license is very likely more restrictive.

Edited by Vítor
Posted

You shouldn’t be automating keystrokes most of the time, but definitely not when there is an alternative. They may be dependent on the user’s configurations, and GUI scripting is a recipe for unpredictability and disaster. You also don’t need that much code; all of it can be replaced with a single line: tell application "Alfred Preferences" to activate (or activate application "Alfred Preferences"). In addition, a Run NSApplescript isn’t necessarily the best option for this, as you have no use for on alfred_script(q). You should likely be using a Run Script with /usr/bin/osascript.

 

Finally, you can’t release the whole workflow under the MIT license since you don’t own Alfred’s icon (that you are using). Not that Andrew or Vero mind you using the icon for this, probably, but still its license is very likely more restrictive.

 

Thanks for the in-depth feedback. I'm new and learning, and really like Alfred. I changed to icon to images in the public domain and made some of the modifications you suggested. Also added a script filter so that people can access Alfred Preferences from the launcher (if they like that sort of thing) and it shows a message when the Alfred Preferences are being loaded after being triggered by a hotkey.

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...