Skip to content

Safari - Clean AppleScript Handling #13

@seandenigris

Description

@seandenigris

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions