luckman212 Posted March 12 Share Posted March 12 Is there any way to programmatically open Alfred's preferences app to specific areas? For example directly to the "Features → Clipboard History" section? Via URL Scheme perhaps? Link to comment
luckman212 Posted March 12 Author Share Posted March 12 (edited) Until there's a better way, I came up with this poor man's solution... 🤷 #!/usr/bin/env bash # quits Alfred Prefs (if open) and then opens it to the Features -> Clipboard tab bid='com.runningwithcrayons.Alfred-Preferences' osascript <<EOS &>/dev/null with timeout of 5 seconds tell application id "$bid" to quit end timeout EOS defaults write $bid lastFeature clipboard defaults write $bid lastTab features open -b $bid Edited March 12 by luckman212 Link to comment
vitor Posted March 13 Share Posted March 13 Could you expand on your use case a bit? What would the programatic access give that is not solved for you with the ? search? Link to comment
luckman212 Posted March 13 Author Share Posted March 13 (edited) Hi @vitor ! The use case is I have a script that does some processing on recent files that are in the clipboard history. For the script filter to work, that feature needs to be enabled. I was able to figure out how to programmatically check for that, but to close the loop I'd like the "action" item from that script filter to directly open Alfred Prefs to the page so the user can enable the checkbox. Indeed, ?clipboard does take me to the correct place! But I was hoping the script could open this for the user automatically. I assume there's probably an undocumented URL scheme available, since I guess that might be how Alfred gets the separate Alfred Preferences.app to open directly to that specific page. Edited March 14 by luckman212 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now