Jump to content

Keypress After Opening a URL

Recommended Posts

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.

Link to comment

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.

Link to comment

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


Capture d’écran 2017-08-30 à 23.10.51.png

Edited by GuiB
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...