Jump to content

AutoLogin Workflow Help


Recommended Posts

Hi all! Looking for what I assume would be a short workflow that will get me to a specific page inside a website but that requires me to login first. I don't care if the workflow has my username and password hardcoded in, so I'm not looking for the workflow to access my lastpass or anything like that. I am NOT a coder in any way, shape or form so I'm hoping someone can point me to a workflow that I can customize accordingly? (Using a Mac if it matters, and chrome)

 

Thanks so much in advance!

 

/leonard

Link to comment

What you're asking for is not very easy, I'm afraid. And it depends entirely on which web browser you use and which website you're talking about. Without at least that information, nobody can give you much in the way of help. It would also help greatly if you have some sort of password manager in your browser.

Edited by deanishe
Link to comment

Well, I don't have LastPass or a Zillow account, but this AppleScript will log you into this forum using the Bitwarden password manager. You'll need to change the simulated autofill keyboard shortcut to the one used by the LastPass extension. And the URLs, obviously.

-- URL of login page
property login_url : "https://www.alfredforum.com/login/"
-- URL of the page we want to go to after login
property wanted_url : "https://www.alfredforum.com/messenger/"

on wait_for_load(_tab)
	using terms from application "Google Chrome"
		repeat until (loading of _tab is false)
			delay 0.1
		end repeat
		log "loaded " & URL of _tab
	end using terms from
end wait_for_load

tell application "Google Chrome"
	-- Get a tab.
	-- If no window is open, create one and grab its tab,
	-- else add a new tab to the frontmost window	
	if (count of windows) = 0 then
		set _window to make new window
		set _tab to tab 1 of _window
	else
		set _window to window 1
		set _tab to make new tab at end of tabs of _window
	end if
	
	-- Tell tab to open a new URL, then wait until
	-- it has loaded
	set URL of _tab to login_url
	my wait_for_load(_tab)
	
	tell application "System Events"
		-- Trigger password manager to insert password
		-- SHIFT+CMD+L is the keyboard shortcut for Bitwarden
		keystroke "L" using {command down, shift down}
		-- Wait for password manager to do its thing
		delay 0.3
		-- Simulate return to submit form
		key code 36
	end tell
	
	-- Wait for login to complete
	my wait_for_load(_tab)
	
	-- alfredforum.com redirects after login, so wait for the second load
	-- before navigating to the wanted URL
	delay 0.1
	my wait_for_load(_tab)
	
	-- Navigate to wanted page
	set URL of _tab to wanted_url
end tell

 

Link to comment
12 hours ago, deanishe said:

Well, I don't have LastPass or a Zillow account, but this AppleScript will log you into this forum using the Bitwarden password manager. You'll need to change the simulated autofill keyboard shortcut to the one used by the LastPass extension. And the URLs, obviously.


-- URL of login page
property login_url : "https://www.alfredforum.com/login/"
-- URL of the page we want to go to after login
property wanted_url : "https://www.alfredforum.com/messenger/"

on wait_for_load(_tab)
	using terms from application "Google Chrome"
		repeat until (loading of _tab is false)
			delay 0.1
		end repeat
		log "loaded " & URL of _tab
	end using terms from
end wait_for_load

tell application "Google Chrome"
	-- Get a tab.
	-- If no window is open, create one and grab its tab,
	-- else add a new tab to the frontmost window	
	if (count of windows) = 0 then
		set _window to make new window
		set _tab to tab 1 of _window
	else
		set _window to window 1
		set _tab to make new tab at end of tabs of _window
	end if
	
	-- Tell tab to open a new URL, then wait until
	-- it has loaded
	set URL of _tab to login_url
	my wait_for_load(_tab)
	
	tell application "System Events"
		-- Trigger password manager to insert password
		-- SHIFT+CMD+L is the keyboard shortcut for Bitwarden
		keystroke "L" using {command down, shift down}
		-- Wait for password manager to do its thing
		delay 0.3
		-- Simulate return to submit form
		key code 36
	end tell
	
	-- Wait for login to complete
	my wait_for_load(_tab)
	
	-- alfredforum.com redirects after login, so wait for the second load
	-- before navigating to the wanted URL
	delay 0.1
	my wait_for_load(_tab)
	
	-- Navigate to wanted page
	set URL of _tab to wanted_url
end tell

 

Hello @deanishe,

 

Is it doable for safari and keychain?

Link to comment
2 minutes ago, deanishe said:

 

Not that way, no. Unless you know a keyboard shortcut to tell Safari to fill the password?

Nope I don't, this is actually why I did not try to edit your script and ask you if you know a different way to do it.

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