r/applescript • u/benoitag • Sep 22 '20
Problems with script execution
Hi ! I'm knew to this community.
I made a little script in order to automate a long authentification process for my school's workspace, and it runs perfectly when launched from the Script editor, but when saved as an .app file, it fails with a prompt saying "Not allowed to send Apple Events to System Events. (-1743)" (it is translated from French but I'm sure you get the idea).
I searched the internet and found out I wasn't the only one with this problem, but the solutions didn't work for me or I haven't enough knowledge to actually understand them...
Under preferences > privacy&secutity > automation ; I have nothing and I don't know how to add it there...
Maybe you guys could have some ideas, and I hope you can help !
Thanks !
here is the script (quite surely scrappy but works) :
tell application "Safari"
activate
open location "https://ector.strasbourg.archi.fr/public/perimetre"
end tell
delay 1
tell application "Safari"
tell application "System Events" to tell process "Safari"
keystroke tab
delay 0.2
keystroke "username"
delay 0.2
keystroke return
end tell
end tell
delay 2
tell application "Safari"
tell application "System Events" to tell process "Safari"
keystroke "username"
delay 0.2
keystroke tab
delay 0.2
keystroke "password"
delay 0.2
keystroke return
end tell
end tell
View all comments
Show parent comment
1
u/benoitag Sep 23 '20
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...