Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Safari - Clean AppleScript Handling #13

Open
seandenigris opened this issue Feb 21, 2022 · 0 comments
Open

Safari - Clean AppleScript Handling #13

seandenigris opened this issue Feb 21, 2022 · 0 comments

Comments

@seandenigris
Copy link
Owner

seandenigris commented Feb 21, 2022

1. Setting to Enable AppleScript

A setting must be enabled to use. Here is how to read and write it:

/usr/bin/defaults write com.apple.Safari AllowJavaScriptFromAppleEvents -bool true
/usr/bin/defaults read com.apple.Safari AllowJavaScriptFromAppleEvents

Unfortunately, the following returns an empty string:

LibC resultOfCommand: '/usr/bin/defaults read com.apple.Safari AllowJavaScriptFromAppleEvents

So not sure if we can check this from inside the image. Maybe documentation is the best we can do here?

2. Delegate to Applescript Project

CwSafari>>#doJavascript: uses Applescript underneath, but CwSafari>>#applescriptTell: is using something handrolled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant