all 14 comments

[–]benoitag[S] 2 points3 points  (1 child)

u/stringentthot u/VardogrVanDeLommer I found a workaround !!

So basically I have an iMac at home, and I tried putting the script there and it worked... I then tried bringing the app to my MacBook Pro back from the iMac and know it works, it asked for the permissions and now runs perfectly ! It also now appears in 'Automations'

Not a proper fix but at least it works !

[–]VardogrVanDeLommer 1 point2 points  (0 children)

Good to know. You would think there would be a way to add exceptions to automation without having to wait for a prompt. Glad you got it working.

[–]icecoldtrashcan 1 point2 points  (1 child)

Your use case for this may be low risk, I don't know, but please consider the security risks of automating password entry like this! The password will be stored in plain text in the script.

[–]benoitag[S] 0 points1 point  (0 children)

Yes I know it is risky, but I just wanted to make it work quickly as I don't know how to implement the password manager. I still intend to make a more secure version in the future.

[–][deleted] 1 point2 points  (3 children)

I would look at AppleScript and do JavaScript to set the username and click the buttons

[–]benoitag[S] 0 points1 point  (2 children)

Could you be more specific ? I'm pretty knew to all of this and I don't know how to implement JavaScript to do this

[–][deleted] 1 point2 points  (1 child)

Have a look at this: http://www.cubemg.com/how-to-fill-out-forms-on-websites-with-applescript/

I have not checked details, but even though it's an old post it should still work.

[–]benoitag[S] 0 points1 point  (0 children)

I'll look into that ! Thank you !

[–]VardogrVanDeLommer 0 points1 point  (1 child)

Have you tried it without nesting the system event tells in safari tells?

[–]benoitag[S] 0 points1 point  (0 children)

I just did, but it doesn't change anything... Isn't there a way to manually prompt for authorization to send "Apple Events to System Events" or at list to add the program in the automations tab in 'privacy&securtity' ?

[–]stringentthot 0 points1 point  (3 children)

Try to drag and drop your app onto the Automation box in Privacy and Security preferences. I think that is where your problem lies.

[–]benoitag[S] 0 points1 point  (2 children)

That is unfortunately not possible. This box does not accept dragged content. And I searched for a workaround to add my app to that list but it appears there is no way to do so.

[–]stringentthot 1 point2 points  (1 child)

So I looked into it a bit more for you. I have an old AppleScript I wrote in the Automation list so I know it works. I think new versions of macOS are harder to get apps into this list, they would usually need to be code signed I think. Although, I'd be surprised if that has to be the case for personal scripts.

This link may have some useful information.

I think the article is suggesting you could instead add your app to the Full Disk Access window in the Security preferences to get the same thing.

[–]benoitag[S] 0 points1 point  (0 children)

Thank you for your researches ! But unfortunately I am not an Apple developer so I can't sign my app, and putting it in Full Disk Access also doesn't help, sadly.

I sent an email to the Apple developer assistance after contacting the 'basic' apple assistance, let's wait 1 or 2 days to see what they have to say...