Jump to content

Script open Browser an Login


Recommended Posts

First of all, what a great community. Thanks for your help, work and sharing it.  :)  :)

 

Now I hope there is help for my problem.

Unter Alfred V1 I was using a Applescript and it worked well.

 

The Script opens Firefox and did a login on a special website.

 

Now with V2 the script starts but opens 2 firefox windows.  :huh:

 

Could anybody please help me and fix the script or build a workflow? Sorry.. I'm a complete newbie.

 

openFirefoxURL("https://specialwebsite.de/")
on openFirefoxURL(x)
	return do shell script "open -a Firefox" & space & quoted form of x
end openFirefoxURL
tell application "System Events"
	delay 4
	tell application "Firefox"
		activate
		tell application "System Events" to keystroke "username"
		tell application "System Events" to keystroke tab
		tell application "System Events" to keystroke "password"
		tell application "System Events" to keystroke return
	end tell
beep
end tell

 

 

Thanks in advance for your help.  :rolleyes:  :rolleyes:

Link to comment

well.. I did it this way.. not sure If everything is right, but it works for me.  ;)

 

Templates -> Essentials -> Keyword to Script

 

/usr/bin/osascript

set mainURL to "<https://website.de>" as text
set mainLogin to "username" as text
set mainPword to "password" as text
--display dialog mainURL

tell application "Firefox"
	activate
	set thisDocument to make new document at end of documents

	tell application "System Events"
		tell application process "Firefox"
			delay 2
			-- keystroke (ASCII character 9) — tab character
			keystroke mainLogin
			--delay 1
			keystroke (ASCII character 9) -- tab character
			--delay 1
			keystroke mainPword
			keystroke (ASCII character 13) -- this equals return
		
		end tell
	end tell
	
end tell
Link to comment

well.. I did it this way.. not sure If everything is right, but it works for me.  ;)

 

Templates -> Essentials -> Keyword to Script

 

/usr/bin/osascript

set mainURL to "<https://website.de>" as text
set mainLogin to "username" as text
set mainPword to "password" as text
--display dialog mainURL

tell application "Firefox"
	activate
	set thisDocument to make new document at end of documents

	tell application "System Events"
		tell application process "Firefox"
			delay 2
			-- keystroke (ASCII character 9) — tab character
			keystroke mainLogin
			--delay 1
			keystroke (ASCII character 9) -- tab character
			--delay 1
			keystroke mainPword
			keystroke (ASCII character 13) -- this equals return
		
		end tell
	end tell
	
end tell

 

Awesome idea. Essentially replacing 1Password ha. Sorry it took me a bi to get back to you, I'm trying to catch up on a ton of posts. Let me know if you need any more help

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...