INTJeff Posted May 17, 2014 Share Posted May 17, 2014 I was trying to make a workflow that will open a specific url in a private window/tab in Firefox, but am not having any luck. Any guidance or help would be appreciated. Link to comment
RodgerWW Posted May 17, 2014 Share Posted May 17, 2014 You will have to use system events to type keystrokes for you. Here's the applescript: tell application "Firefox" to activate tell application "System Events" keystroke "p" using {shift down, command down} -- Open New Private Window keystroke "l" using {command down} -- Select the URL field keystroke "http://www.hotmail.com/" & return -- Paste URL and hit ENTER end tell Just change the hotmail URL within the quotes to whatever your URL is. INTJeff and krong 1 1 Link to comment
INTJeff Posted May 17, 2014 Author Share Posted May 17, 2014 Thanks, RodgerWW . . . One thing, though. I'm new to Alfred. Where do I paste the above? Link to comment
INTJeff Posted May 17, 2014 Author Share Posted May 17, 2014 Okay, here's what I did. I pasted the above into the window called "Run NSAppleScript" so that it now looks like this: on alfred_script(q) -- tell application "Firefox" to activatetell application "System Events" keystroke "p" using {shift down, command down} -- Open New Private Window keystroke "l" using {command down} -- Select the URL field keystroke "http://intjforum.com/" & return -- Paste URL and hit ENTER end tellend alfred_script The only thing is, it seems Firefox must be the active application when I use my keyword (in this case, "intj") for it to work (e.g. I can't be in an iTunes Window, then toggle Alfred, then type in my keyword). Can it be modified to account for this? Also, you'll notice I changed the url . . . that is the site I'd like to use for this. I was wondering if there'd be any way to modify the applescript so that the "user name" and "password" fields are filled and the "Remember Me?" box is ticked and the "Login" button is pressed. Thank you. Link to comment
INTJeff Posted May 17, 2014 Author Share Posted May 17, 2014 Also, I would like to modify the workflow so that if I want to bring up another site, it would be just another private tab instead of a private window. This would be similar to the basic alfred keyword "google" then search term (it just opens in another tab if a firefox window is already open instead of another window). Link to comment
RodgerWW Posted May 17, 2014 Share Posted May 17, 2014 Okay, here's what I did. I pasted the above into the window called "Run NSAppleScript" so that it now looks like this: The only thing is, it seems Firefox must be the active application when I use my keyword (in this case, "intj") for it to work (e.g. I can't be in an iTunes Window, then toggle Alfred, then type in my keyword). Can it be modified to account for this? Also, you'll notice I changed the url . . . that is the site I'd like to use for this. I was wondering if there'd be any way to modify the applescript so that the "user name" and "password" fields are filled and the "Remember Me?" box is ticked and the "Login" button is pressed. Thank you. REMOVE the "--" in front of 'tell application "Firefox" to activate' that is an applescript comment delimiter, therefore, the command AFTER the "--" is ignored: This is why Firefox was not activating. Question: If you are Private browsing, is the "remember me" really going to be saved to the HD? I thought the idea of Private Browsing was that no cookies would be saved to the HD? One way I think you could add the login and password would be to add more keystrokes. For instance: if you hit TAB on your keyboard, does the focus go to the User Name Field for you? Then, another TAB and it moves to Password...etc. So: adding the following after the 'keystroke "http://intjforum.com/" & return -- Paste URL and hit ENTER': delay 2 -- Adds a delay after the URL is entered to allow for loading the site keystroke tab -- Selects the User Name field keystroke "yourusernamehere" keystroke tab & return -- Selects the Password field keystroke "yourpasswordhere" & enter KEEP IN MIND: your password and login will be clearly obtainable if anyone looks through your Alfred workflows and happens upon this script. About the new private TAB, I'm not entirely sure how to do that in an already active window ... perhaps someone else can chime in on that to modify the applescript. Link to comment
henri2398 Posted November 24, 2014 Share Posted November 24, 2014 If you are looking private mode particularly in Mozilla then here just follow the steps mentioned in the below post that will help you how to open a private tab in Firefox. How to Enable Private Tabs in Firefox? 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