bichonfrise74 Posted August 31, 2017 Posted August 31, 2017 I am using a 'Script filter' and piping the result to 'Open URL'... my issue is that after 'Open URL', I want to simulate pressing the keys 'l' and 'enter'. How can I do this? Thanks.
GuiB Posted August 31, 2017 Posted August 31, 2017 Connect two "Dispatch Key Combo" after your "Open URL" object. One that press the "l" and the other that press "enter". I don't know what you are trying to do, but if you want to open an url and then do those key press, then you may need to wait that the URL is opened before doing the key press... If so, you may need to insert a "Delay" object to wait a little before making the key press.
bichonfrise74 Posted August 31, 2017 Author Posted August 31, 2017 Thanks... but I don't see anything that can be connected with the 'Open URL' object... do you mind taking a screenshot of the workflow of what you mean? By the way, my Alfred is 2.3. Basically, my goal is to have a 'script' generate a specific URL based on an argument that I supply (this is why I am creating a 'script filter' for this), then it will open the URL in the default browser... This works great. But! when the URL is opened, I need to simulate pressing certain shortcut keys to, eg. maximize the screen, disable certain functions.
GuiB Posted August 31, 2017 Posted August 31, 2017 (edited) Ok, then I don't know if it's possible to connect something or not to an "Open URL" object in Alfred 2, but you should be able to connect the other objects in parallel to the "Open URL" so they will be activated at the same time. Again, a delay should help Sorry, I don't have Alfred 2 installed at the moment, but here are some screenshots that would show you what I mean. Also, I don't think there was a delay object in Alfred 2, so you should be better with a "Run Script" set to the applescript language and that would do the delay and the keypress... Like that: tell application "System Events" delay 0.3 keystroke "l" & return end tell Look at my last example in the screenshot to see how to connect them if you can't connect them one after the other Edited August 31, 2017 by GuiB
vitor Posted September 1, 2017 Posted September 1, 2017 On 31/08/2017 at 4:15 AM, GuiB said: I don't think there was a delay object in Alfred 2 There isn’t. Neither that nor the Key Combo.
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