afordturtle Posted July 25, 2020 Share Posted July 25, 2020 (edited) I have a workflow where I copy 6 different lines of text and then paste them into 6 different browser fields. I am trying to write an Alfred workflow using Applescript to do this for me automatically. Therefore I need to copy the six different lines of text, invoke the workflow, so that it: Invokes the Alfred clipboard history viewer. Paste the sixth entry. Tabs to the next field. Repeats.... I have this script so far which invokes the Alfred clipboard history viewer, but the next "System Events" line in which command-6 keyboard shortcut is executed still targets the browser....and not the Alfred clipboard history viewer prompt window: tell application "System Events" keystroke "v" using {command down, option down} end tell tell application "System Events" keystroke "6" using {command down} end tell I tried targeting the app itself "Alfred 4" like below, but it does nothing: tell application "System Events" keystroke "v" using {command down, option down} end tell tell application "System Events" tell application "Alfred 4" to activate keystroke "6" using {command down} end tell Can someone help? Thank you! Edited July 26, 2020 by vitor Marked as solved Link to comment
dfay Posted July 25, 2020 Share Posted July 25, 2020 (edited) For something this complex, UI scripting is going to be pretty fragile. I’d recommend using a scriptable browser like Fake ( http://fakeapp.com ) instead. Or this approach: https://www.alfredforum.com/topic/11833-solved-how-to-write-an-alfred-workflow-to-go-to-bottom-of-github-page-and-click-commit-changes-button/ Edited July 25, 2020 by dfay Link to comment
afordturtle Posted July 25, 2020 Author Share Posted July 25, 2020 I was actually able to accomplish this using a combination of applescript (to tab to the next fields), and the Alfred "copy to clipboard" workflow module. https://www.alfredapp.com/help/features/clipboard/accessing-clipboard-history/ Thanks for the reply! dfay 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