What a script may do
Read Only is the default and the right level for most connections: reporting and export scripts
need nothing more. Raise a connection to Read & Write in its Advanced pane only when a script has
to write to it.
Read & Write is not a way past Safe Mode. A statement that drops or truncates always raises a
confirmation naming the app that sent it, whatever the level says, and Safe Mode’s authentication
step still runs.
Automation permission is granted per sending app, not per connection. Granting Terminal control of
TablePro lets any script run from Terminal read every connection that is not Blocked. Revoke it in
System Settings > Privacy & Security > Automation.
Every scripted statement is written to the history drawer under AppleScript, and to the
execution audit log.
Objects
connections lists every saved connection whose External Clients level is not Blocked, sorted
by name. Reach one by name or by id.
connection
No credential is reachable from a script, and neither is the account name. Every property is read only.
tab
current tab and current connection on the application are the front window’s.
Every property is read only. To put SQL in front of someone, use the URL scheme’s
query link, which shows them the statement first.
query result
A record. Assign it to a variable and the rows stay with it.
A cell is always text. NULL is the empty string, and binary is Base64.
Commands
run query
query result. No window opens and no tab is disturbed; the
connection opens first if it is closed, which can prompt for a password.
row limit defaults to 500 and caps at 10000. timeout defaults to 30 seconds and caps at 600.
Several statements in one call are refused, as are statements that read files or run server-side
code.
AppleScript gives up on any command after two minutes. Wrap a long query in
with timeout of 300 seconds.
open table
connect, disconnect, show
connect opens the session without opening a window. show brings the connection’s window
forward, opening one if it has none.
focus
Read the grid
selection reads what is selected in the tab’s grid, in display order, with hidden columns left out
and the filter bar applied. An empty selection reads as zero rows; current result reads them all.
Errors
A refusal is an ordinary AppleScript error carrying the reason.Related
- URL scheme drives the GUI and returns nothing
- MCP tools cover schema, export and server work a script cannot reach
- Safe Mode is the gate in front of every write

