Jump to content
Sign in to follow this  
DJay

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:

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  
×
×
  • Create New...