Updated AppleScript (markdown)

Cameron Kaiser 2019-02-18 05:45:06 +00:00
parent 2cb03faaff
commit f8d03d6655

@ -85,6 +85,16 @@ A script like this could be handy to display a changing web page in a separate d
To stop this script, Alt-Tab to the Script Editor and click Stop, then return to TenFourFox and press Command-W to close the window.
You can also get what the user currently has selected in the window which your script can act on further. This script displays whatever text you have selected/highlighted in a dialogue box.
```
tell application "TheApp"
display dialog ("" & selected of current tab of front browser window)
end tell
```
This could be the basis of things you put in the Scripts menu for interactive operations on web page text. If images are selected, then their "alt texts" are used instead.
## GUI scripting
When GUI scripting is enabled (make sure `Enable access for assistive devices` is checked in `System Preferences` and/or check `Enable GUI Scripting` in `AppleScript Utility.app`), you can manipulate some TenFourFox widgets and send clicks and keyboard events to the application. There is one irregularity in that the `System Events` target is `TenFourFox` always, not the filename of the actual browser (don't change that in these examples, just TheApp as before).