Draw freehand from applescript

I am trying to draw some freehand data to pages using applescript. I have some pixel data which I am using to create a series of line objects in my document to represent the freehand drawing. This seems to work fine however the problem is that I would like to group these objects into one. There seems to be no support in the applescript dictionary for grouping objects so I have been trying to send key commands to group the lines after creating them. Any ideas on how I can group the points into one object?

Mac OS X (10.6.6)

Posted on May 9, 2011 9:38 AM

Reply
2 replies

May 9, 2011 3:09 PM in response to allbabel

Well, more as proof-of-concept than as a perfect solution, you can do it this way:


tell application "Pages"


select every graphic of document 1 of window 1


activate

my groupMaker()

end tell


on groupMaker()

tell application "System Events"

tell process "pages"

tell document 1 of window 1


keystroke "g" using {command down, option down}

end tell

end tell

end tell

end groupMaker


You probably want more nuanced control over the selection process (unless you're always doing this in a new document), but that might require a separate GUI-scripting subroutine which I don't want to get into unless you need it.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Draw freehand from applescript

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.