zeltak Posted June 7, 2019 Share Posted June 7, 2019 Hi all complete neewb (also on mac coming from years of linux) was wondering if one can launch and app via alfred and send keystrokes in succession? for example i would like to launch/focus macpass and immediately send a Command-f keystroke to focus the search bar is that possible at all? best Z Link to comment
deanishe Posted June 7, 2019 Share Posted June 7, 2019 (edited) This AppleScript should work (I don't have MacPass to test it with, but it works with Safari). Put it in a Run Script box with Language = /usr/bin/osascript (AS) tell application "MacPass" -- Bring app to the front, starting it if necessary activate -- Wait until app windows have opened (in case app wasn't running) repeat until (count of windows) > 0 end repeat end tell -- Simulate CMD+F tell application "System Events" to keystroke "f" using {command down} Edited June 7, 2019 by deanishe Link to comment
zeltak Posted June 8, 2019 Author Share Posted June 8, 2019 (edited) thx so much! that’s amazing @deanishe any chance (and this may be asking to much so feel free to ignore) that it actually passes the string from alfred? so once can go ? Aflred> type my key for the above script> followed by `gmail` and the script sends the `gmail` string inside the CMD+F box? thx again Z Edited June 8, 2019 by zeltak Link to comment
deanishe Posted June 9, 2019 Share Posted June 9, 2019 I've built a simple workflow that passes your query to an application's own search by sending ⌘F. It's configured to use Safari by default. Change that to "MacPass" in the workflow configuration sheet. You probably want to change the workflow's icon, keyword and title etc., too. Link to comment
zeltak Posted June 28, 2019 Author Share Posted June 28, 2019 wow this is amazing sorry for the late response (life, work, you name it this past few weeks :)) but for some reason this only brings up macpass focuses the search box but dosent seem to type anything here are my current settings any clue why? thx! z Link to comment
deanishe Posted June 28, 2019 Share Posted June 28, 2019 8 minutes ago, zeltak said: any clue why? Sorry, no. I can't seen anything wrong with your settings, and it works for me. 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