AppleScript Text Insertion at Cursor (Pages 6.3)
I would like to insert text at my cursor position in Pages 6.3 using AppleScript.
I found this subject that works with Pages 09' but this is obsolete with later versions of pages since it throw the error "Pages got an error: Can’t make content of selection into type specifier". (I tested myself with both versions to make sure it was working with 09' and it does)
I tried with Pages 6.3:
set selection to "test"
and tried:
set content of selection to "test"
None of them worked.
When I tried:
set C to characteroffsetof (get selection)
I got the error "Pages got an error: Can’t get selection."
Here is the full script:
tell application "Pages"
--set selection to "test"
--set content of selection to "test"
--set C to character offset of (get selection)
end tell
I can't find any documentation about selection anywhere, did anybody managed to write text at the cursor position with the latest version of Pages using AppleScript?
Thank you!
MacBook Air, macOS High Sierra (10.13.3), null