vitor Posted December 21, 2021 Share Posted December 21, 2021 (edited) Usage Search all your shortcuts via the sc keyword or search by folder name with scd. ↩: Run the shortcut.⌘↩: Run the shortcut with an argument.⌥↩: Open the shortcut for editing.Use the Universal Action to run the shortcut on files or as another way to provide an argument. The list of shortcuts is cached for faster results. An immediate cache rebuild can be forced with ⌘⌥⌃↩. ⤓ Install on the Alfred Gallery | Source Edited July 11 by vitor Grug, Vero, cands and 4 others 6 1 Link to comment
vitor Posted December 21, 2021 Author Share Posted December 21, 2021 Saving the second post for debugging instructions, if they are ever needed. Grug 1 Link to comment
Ligeard Posted January 11, 2022 Share Posted January 11, 2022 Thanks for the workflow ! But it doesn't work to me. I send you a private message with the debug infos. Link to comment
vitor Posted January 11, 2022 Author Share Posted January 11, 2022 4 hours ago, Ligeard said: I send you a private message with the debug infos. Please don’t split the conversation. Either send a private message or post to the thread, not both. Preferably the latter so other people can benefit from the conclusions. Can you check if this one works for you? Link to comment
vitor Posted January 16, 2022 Author Share Posted January 16, 2022 Got no reply but updated the Workflow to that version anyway. I’m confident it’ll work. Link to comment
brian_seidman Posted January 19, 2022 Share Posted January 19, 2022 With the 2022.1 version of the Alfred Shortcuts workflow, I'm having an issue where if the Shortcut has some sort of output (text) that it would copy to the clipboard ("Copy to Clipboard" step in Shortcuts), that output does not seem to copy to the clipboard. It works just fine in the 2021.1 version. In debugging, the 2022.1 Alfred Shortcuts workflow does run a Run Script step to Copy to Clipboard that does seem to have the correct output within it, but for some reason I'm not able to paste that output — Cmd + V doesn't work, and neither does the output show up in my clipboard history in Alfred. The final Copy to Clipboard step in the 2022.1 Alfred Shortcuts workflow is not marked as transient; I do see that the "middle" Copy to Clipboard steps are marked as transient, but toggling that only copied the name of the shortcut to the clipboard, not the text output. Seems like something that changed between the 2021.1 version and the 2022.1 version is causing the issue. Overall the workflow is great and thanks so much for releasing it! 🎉 Link to comment
vitor Posted January 19, 2022 Author Share Posted January 19, 2022 @brian_seidman Nice analysis, you are correct. To circumvent NSTask decomposition I use the clipboard as a temporary placeholder of information but do not pollute the history and restore the clipboard to what it was when the Workflow ends. I hadn’t consider the shortcut itself might change the clipboard and that in that case the Workflow shouldn’t restore it. Just released 2022.2 which fixes it. brian_seidman 1 Link to comment
vitor Posted January 23, 2022 Author Share Posted January 23, 2022 (edited) Two updates today: When writing an argument to a shortcut, the shortcut’s name will show. Allow multiple paths in File Action. Edited January 23, 2022 by vitor Grug 1 Link to comment
rowankaag Posted February 3, 2022 Share Posted February 3, 2022 This is awesome! Alfred rookie here: would it be possible to modify the Alfred Workflow in such a way that "sc" is automatically run upon any input within Alfred? Like the way apps and files are automatically searched when you start typing, I'd love to search for Shortcuts without prefixing my query with 'sc'. Link to comment
vitor Posted February 3, 2022 Author Share Posted February 3, 2022 7 minutes ago, rowankaag said: would it be possible to modify the Alfred Workflow in such a way that "sc" is automatically run upon any input within Alfred? It is not. Alfred works that way by design. Imagine the case where you had one (or multiple!) slow Workflows all trying to shove their results in the regular search. It would be a mess. Link to comment
rowankaag Posted February 3, 2022 Share Posted February 3, 2022 6 hours ago, vitor said: It is not. Alfred works that way by design. Imagine the case where you had one (or multiple!) slow Workflows all trying to shove their results in the regular search. It would be a mess. That does make a lot of sense. Do @Vero / @Andrew / @deanishe or you know if there is “native support” planned (as is the case with files / applications / etc) on the current roadmap for Alfred? Link to comment
vitor Posted February 4, 2022 Author Share Posted February 4, 2022 19 hours ago, rowankaag said: if there is “native support” planned Because the behaviour is on purpose, it’s unlikely it will change unless the reasons for it also do. Files and applications are predictable (i.e. Alfred knows what to expect and can prepare for oddities) but Workflows can be anything. Link to comment
felixpy Posted February 5, 2022 Share Posted February 5, 2022 Is it possible to adjust this shortcut to only show shortcuts from a predefined folder e.g. "Mac"? I can't figure out how to tweak the code! Link to comment
vitor Posted February 6, 2022 Author Share Posted February 6, 2022 6 hours ago, felixpy said: Is it possible to adjust this shortcut to only show shortcuts from a predefined folder e.g. "Mac"? Create a Keyword Input or Hotkey Trigger and connect it to a Show Alfred Utility with argument sc Folder Name (e.g. sc Mac ). Then whenever you call the Keyword or invoke the Hotkey, it will be repopulated to only show that folder. Set this up outside the Workflow, in another one, so it doesn’t get overwritten on updates. Link to comment
vitor Posted July 13, 2022 Author Share Posted July 13, 2022 (edited) Updated to 2022.9. Use Alfred 5 Run Shortcuts object. Do not accept new arguments when start from File Action or Universal Action. Remove update conditional. Edited July 13, 2022 by vitor Link to comment
vitor Posted October 8, 2022 Author Share Posted October 8, 2022 Updated to 2022.11. Add configurable keyword. Link to comment
vitor Posted March 21 Author Share Posted March 21 Updated to 2023.2. Cache shortcuts list, which speeds it up for people with hundreds of shortcuts. Link to comment
vitor Posted April 29 Author Share Posted April 29 Updated to 2023.6. Change cache rebuild shortcut to ⌘⌥⌃↩. Link to comment
brian_seidman Posted May 9 Share Posted May 9 (edited) @vitor, Suddenly having some trouble with the Shortcuts workflow; apologies in advance if this gets chalked up to user error. Possibly this is a problem with the Run Shortcuts object, but I figured you’d be able to gauge either way. Basically, I’m able to pass a string to the Shortcuts workflow via Universal Action and Run Shortcut on it, but not a file/folder. I’ve made test shortcuts that receive all types of input and then return a notification. These shortcuts will receive an string argument from Alfred and then correctly return that argument as a notification. If I pass in a file as a string (“Treat Input as String”) in the Run Shortcuts object, the notification returns that file path as a string. But, if I choose “Treat Input as File(s),” the notification is blank and shortcut steps like “Reveal File” don’t take any action, and Quick Look reports nothing was passed via Shortcut Input. I put in a couple of Debugs into your Shortcuts workflow, and it looks like the workflow is passing the right information to the Run Shortcuts object — the JSON Config object is passing an “inputmode” of 1 for files and 0 for strings, etc. That’s why I’m wondering if it’s something in the Run Shortcuts object itself; the correct data is being passed to the Run Shortcuts object, but irrespective if Run Shortcut is directly configured or configured via JSON Config, it still doesn’t seem to function on file arguments. I have tried regressing my version of the Shortcuts workflow, but that didn’t help. I don’t believe I can download an earlier version of Alfred (back to v5.06), but that would be the next thing I’d try with the newest version of the Shortcuts workflow, again to see if the newest iteration of the Run Shortcuts object in Alfred is causing the issue. I appreciate any insight you can provide. Thanks! P.S. Workaround that does seem to work is getting a file/folder via Universal Action, and then passing that argument to a Run Script object, /bin/zsh, that runs `shortcuts run SHORTCUT_NAME -i $query`, the command line version of Shortcuts. I don't think that illuminates anything necessarily, except that Shortcuts can indeed take an Alfred argument and run with it, just seemingly not through the Run Shortcuts object. Edited May 9 by brian_seidman Link to comment
vitor Posted May 9 Author Share Posted May 9 1 minute ago, brian_seidman said: Basically, I’m able to pass a string to the Shortcuts workflow via Universal Action and Run Shortcut on it, but not a file/folder. It’s not user error, it’s Apple error. The regression is in Shortcuts itself in a recent version of Ventura. We’re aware and it’s already been reported to Apple. Ostensibly Apple gives priority to bugs with multiple reports, so if you’d like to help bump that up create a report with Feedback Assistant with the name Regression: "Shortcuts Events" fails on list of files and in the body mention you’re duplicating FB12163725. It’s not even the only broken feature Shortcuts has, unfortunately. The shortcut has already needed to change once before due to it. Floating.Point and brian_seidman 2 Link to comment
Floating.Point Posted July 31 Share Posted July 31 This one just bit me, leading me here. Maybe it would be worth adding a warning to the Run Shortcut node dialog explaining that 'treat input as File(s)' is currently broken 🤷♂️ Link to comment
vitor Posted August 2 Author Share Posted August 2 (edited) Cautiously optimistic about it being fixed. It’s still broken on the current Ventura release (13.5, released on the 24th) but appears to have been fixed on the current Sonoma beta (4, released on the 25th). Hopefully the fix will be retrofitted to the next Ventura release. Edited August 3 by vitor Floating.Point 1 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