addEdgeBookmarkSearch Posted August 10, 2023 Share Posted August 10, 2023 I want to create a workflow like this: changing the "Sort By" option of the frontmost window of Finder using different arguments. However, I haven't found any useful tasks in the Finder section of the "Automation task" in Alfred. Is using AppleScript GUI Scripting the only way to implement this? Link to comment
zeitlings Posted August 13, 2023 Share Posted August 13, 2023 Finder's scripting definitions seem to allow for sorting (so no GUI scripting, but AppleScript nonetheless). Quote sort v : Return the specified object(s) in a sorted list sort specifier : a list of finder objects to sort by property : the property to sort the items by (name, index, date, etc.) → specifier : the sorted items in their new order You can see the documentation via Script Editor (App), File > Open Dictionary (⇧⌘O) > Finder (from the list). By the by, Vitor has a neat workflow to open AppleScript Dictionaries. addEdgeBookmarkSearch and vitor 2 Link to comment
addEdgeBookmarkSearch Posted October 17, 2023 Author Share Posted October 17, 2023 I occasionally find that "Sort By" has default shortcuts. So I can use keystroke simulation via AppleScript: tell application "System Events" key code 21 using {command down, option down, control down} end tell Maybe activate Finder first if it's necessary in your workflow. Finder's scripting definitions, which zeitlings mentioned, may be more elegant, but I'm not very familiar with AppleScript. Link to comment
sepulchra Posted October 18, 2023 Share Posted October 18, 2023 I think you should be able to do this two ways without any scripting @addEdgeBookmarkSearch 1. Automation Task called "Click Menubar Item in Frontmost App." 2. Dispatch Key Combo object for each shortcut addEdgeBookmarkSearch 1 Link to comment
addEdgeBookmarkSearch Posted October 20, 2023 Author Share Posted October 20, 2023 On 10/18/2023 at 10:55 PM, sepulchra said: I think you should be able to do this two ways without any scripting @addEdgeBookmarkSearch 1. Automation Task called "Click Menubar Item in Frontmost App." 2. Dispatch Key Combo object for each shortcut Thank you for your advice! After my verification, both of these methods work and are more elegant! Thanks to the Alfred development team for creating such great software! It seems I need to systematically learn the new features of Alfred so that I can use it more effectively.🥹 Link to comment
sepulchra Posted October 20, 2023 Share Posted October 20, 2023 I had no idea "Click Menubar" was in automation tasks until last week. It is really a useful one! 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