Jump to content

command to open workflow preferences?


Recommended Posts

@giovanni That's essentially built-in now, if I've understood correctly what you're looking for. :) 

 

Just type the question mark followed by any feature name, workflow name or keyword, even the word "hotkeys" or "keywords" to see relevant results from your features and workflows.

 

More details about the feature can be found here:

https://www.alfredapp.com/blog/tips-and-tricks/search-alfred-question-mark-trick/

 

Cheers,
Vero

Link to comment

I meant launching through the workflow something like '?{query}' where {query} is a workflow name selected from a list of the installed workflows (which is provided by 'alfred-extension').

 

In other words:

1. the user launches 'alfred-extension` which returns a list of installed workflows

2. the user selects workflow X

3. Alfred opens the workflow X configuration page in Alfred preferences. 

  

Link to comment
  • 2 weeks later...

Alfred internally has a URL scheme to open the preferences to certain pages, sometimes used by the ? keyword. I'm reluctant to make this a public accessible feature as this makes it significantly more tricky to make changes in the future for something which won't be used much.

 

Having said that, in my wider plan, I do have some ideas written down to make a configurable user-facing "preferences" per workflow which would show when installing a workflow.

Link to comment
  • 11 months later...

I came back to this request as I am updating this old workflow, and I would really like to be able to open a workflow's configuration from it.

I came up with this script below which works, but obviously flickers Alfred for a moment.

I just wanted to check with the experts that this is currently a reasonable solution. Thanks!

 

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import subprocess
myString = 'myWorkflow'

launchArgs = "tell application id \"com.runningwithcrayons.Alfred\" to search \"?{}\"".format(myString) 
subprocess.check_call(["osascript", "-e", launchArgs])

launchArgs = "tell application \"System Events\" to key code 36"
subprocess.check_call(["osascript", "-e", launchArgs])

 

 

Edited by giovanni
Link to comment
16 hours ago, giovanni said:

this is currently a reasonable solution.

 

Given the constraints, yes. You can improve it by using ?workflow myString instead of ?myString. That way you guarantee to only match against Workflow names, not their objects.


But why are you running AppleScript code through Python, is it part of a larger script? If not, run it directly because it will be faster, more readable, and more resilient.

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