Couldn't write data because C and Objective-C pointers cannot be saved in scripts

Now trying my first subroutine in AppleScript…

set DBfile to “~/Documents/Databases/MY.db” --SQL database
set MYdb to open db in file DBfile with can write
set aThisStage to “Main”
set statusGO to “GO”

PutState(MYdb, aThisStage, statusGO)
–>Causes subject error -1763

–PutState updates one column in the specified row
on PutState(iDB, iStage, iState)
update db iDB sql string “Update Status set State="” & iState & “" where Stage="” & iStage
end PutState

offending objects is:
«data optr00000000E010FC0000600000»


Hi Oxylos.

Could you please put three backticks above and below any AppleScript and/or ASObjC code when posting it here?

AppleScript/ASObjC code

When the post is displayed, they’ll make the code appear in a box with an “Open in Script Editor” button and prevent quotes from being smartened, “--” from being changed to “–”, etc. More Markdown formatting information here.

1 Like

Will do. Sorry knew nothing re Markdown

This is an issue that I’ve hit several times with AppleScript and Script Debugger in Debugging mode. Is that the context you in?

If so, turn off debugging mode and see if that works. One workaround is to save the portion of your scripts that use the pointers as an app and call the app from the script (when in debugging mode).

If that’s not the context then the separate app may still help, but good luck writing and editing it.