Absurdly Simple 1Password Solution

I use 1Password heavily and as am fond of its ability to create autofill bookmarks as I am annoyed by Safari's insistence on asking if it's ok to open them.

2021-11-07_06-25-51_PM2

In my case, the answer is never "Cancel," and the solution to "stop asking me that!" is so simple I'm embarrassed to admit I snarled "Allow! curséd Safari!" for a year before putting a stop to it.

All it takes is one little AppleScript in Safari's scope.

Allow 1Password.kmmacros (2.8 KB)

image

7 Likes

Just curious…

When do you see this kind of pop-up? I'm a 1Password user as well but don't remember this one.

1 Like

When an autofill bookmark created by 1Password is chosen in macOS Safari, macOS requires Safari to explicitly get permission to talk to 1Password.

macOS security has gotten very tight in recent years, and while I approve of that in practice, Safari really ought to have a preference to whitelist such transactions.

I haven't tested this in other browsers.

Hi @commiepinko I was always bothered that the 1Password no autofill login for Mac apps, as on iOS, get.

Thanks to Keyboard Maestro, this is no longer a problem for me :wink:

Here are two examples:

https://twitter.com/myapfelworld/status/1402378154535161865

https://twitter.com/myapfelworld/status/1402365620566597635

Here is my Authy Autofill login, which is started when I open the app:

02)Authy Desktop <D790 211116T233052>.kmmacros (114,2 KB)

1 Like

I'm getting a similar pop-up when I try to fill in the credit card information. My system is in another language so I changed the word "Allow" in AppleScript. It works, but not when the Safari window is active. I have to switch to a different app, then back to Safari and then it clicks.

Thanks! Now I'm sad not so many apps installed on my system use master password :smiley:

@commiepinko, I have found this thread from Dan. Do you think something like Authy AutoFill could work with mounting encrypted Time Machine drive?

Have a great day guys!

@roskozmos with Authy it will not work.

However with 1Password. If you don't use 1Password, you can create something similar with the keychain management.

The tutorial is in German, but you will be able to follow the steps/functionality:

Another possibility would be to insert the password directly when you connect your external hard drive.

2021_12_01_Support_1

2021-12-01_11-19-20

I use 1Password. Now, thanks to your macro 1Password can unlock the Authy app in seconds. I can imagine this macro could be easily modified for other apps by changing the application name as a trigger. But what about a pop-up asking for a password to access an encrypted external drive?

(Sorry, it's in Slovak)

How do you trigger that?

1 Like

@roskozmos this macro should solve your problem.

Please replace @iMac with the name of your password. I have disabled the pushover notification action.

The first shortcut in the macro opens the 1Password Mini window.

2021-12-01_18-41-20

(sorry it`s in German :wink:)

You still have to adjust the screenshots in the macro. If you have any questions, please contact me.

07)Updates:DMG:Sync.kmmacros (114,5 KB)

1 Like

And it does! Thank you! :pray:

I couldn't figure out how to trigger it automatically after a pop-up "SecurityAgent" appear so I tried a different approach with the help of AppleScript.

First, it worked just fine. But then it broke somehow.

Mac mini 2021-12-03 o 16.44.46-pty-fs8

Anyway, this approach has a big disadvantage. Your password is visible in KM.

@roskozmos You start the macro with the AppleScript command to run the backup. Then you pause the macro with the action (Pause until - Image found).
When the input for password input appears, the macro continues with the input of the password from 1Password.

I do this with my apps, which also display a password entry window after launching.
Here is an example with the Boxcryptor app

2021-12-03_20-02-00

@appleianer , Thank you!

I found out there is no need to type the password again and again when the drive is still attached. So, after the system starts, the "SecurityAgent" pop-up appears and I can run macro which mounts the drive, with the help of 1Password. Next, the second macro with AppleScript for scheduling TM backups should work just fine.

set driveName to "Backup HDD"
set driveInfo to do shell script "diskutil list | grep "" & driveName & """
set driveID to last word of driveInfo

do shell script "diskutil mount " & driveID & ""

Pause, and then run

set driveName to "Backup HDD"
set driveInfo to do shell script "diskutil list | grep "" & driveName & """
set driveID to last word of driveInfo

do shell script "diskutil unmount " & driveID & ""

Wunderbar!

1 Like

Hi @appleianer ,
I've seen your videos on YT. Great stuff! I'm thrilled by the automatic translation feature by Google. Anyway, watching a few videos helped me understand how to modify your macro for App Store or System Preferences. I still cannot figure out how to deal with system permissions. For example:

Mac mini 2021-12-05 o 17.35.15-pty-fs8
MacBook Pro 2021-12-01 o 13.02.14-pty-fs8

For daily use, I use a standard user account. Each time I want to make changes I have to type username. It's not a big deal to type "sysadmin" and hit the tab key, but I'm just curious if the macro can grab a username first and then a password from 1PW.

Thanks for any advice! Appreciate your work!

1 Like

@roskozmos thank you for your feedback. I need to make some new videos again :wink:

The following macro is to fill in the username (sysadmin) and password by 1Password.

In the KM actions marked in red, please enter the username of the 1Password login (probably sysadmin).

8edcec8a7e82c443d0458afc2b2717bac72a7688

Now trigger the Autofill macro (Sortcut or Palette)

09)Updates:DMG <EFDA 211205T210619>.kmmacros (115,2 KB)

For this use case remove the green marked actions in the KM macro bite above:

Mac mini 2021-12-05 o 17.35.15-pty-fs8

If everything goes right, it will work as seen here:

2021_12_05_Support_1

yes, you should!

thanks for helping me out with the username. It works in System preferences. I'm still struggling with autorizing permissions. For example, moving app from aplications folder to the trash.

It seems 1Password search worked just fine. But I get stuck to this exact spot.

Mac mini 2021-12-06 o 6.33.23

maybe this is something different than "com.apple.SecurityAgent"?

tell application "System Events" to tell process "1Password mini"
	keystroke "c" using {command down, shift down}
	delay 0.2
	tell application "com.apple.SecurityAgent" to activate
	delay 0.2
	tell application "System Events"
		keystroke "v" using command down
		delay 0.5
		keystroke return
		delay 1
		tell application "Finder"
			set the clipboard to " "
		end tell
	end tell
end tell

@roskozmos you use this, for password prompts for updates, uninstalling apps.

tell application "System Events" to tell process "1Password mini"
	keystroke "c" using {command down, shift down}
	delay 0.2
	tell application id "com.apple.SecurityAgent" to activate
	delay 0.4
	tell application "System Events"
		keystroke "v" using command down
		delay 0.5
		keystroke return
		delay 1
		tell application "Finder"
			set the clipboard to " "
		end tell
	end tell
end tell

You use this AppleScript if you need to unlock the system settings

    tell application "System Events" to tell process "1Password mini"
	keystroke "c" using {command down, shift down}
	delay 0.2
	tell application "System Preferences" to activate
	delay 0.2
	tell application "System Events"
		keystroke "v" using command down
		delay 0.5
		keystroke return
		delay 1
		tell application "Finder"
			set the clipboard to " "
		end tell
	end tell
end tell

It is also important that you have added these two library apps to the System Accessibility.

Have you adjusted these screenshots for this as well?

2021-12-06_11-07-36

1 Like

unfortunately, it didn't help. It finds and copies the password but don't paste it back.

Mac mini 2021-12-06 o 12.02.24-pty-fs8

yop, I added both from CoreServices.

yes, I replace it with my 1PW profile pic.

Can you please give me the password macro here. Then I'll have a look.

I'm a bit lost on this one. If you want to delete an app, then you have to approve it with your system/Mac password?
What settings do you have that you have to confirm such processes with your system password?

I use the current version of 1Password 7, do you?

Sorry my friend. Stupid mistake. I updated just one AppleScript in the macro. Not the second one :man_facepalming:. It works, finally! Big thanks!

@roskozmos I'm glad it works for you now. Then have fun with the Autofill :wink:

1 Like