The Omni Group Forums

The Omni Group Forums (
-   OmniGraffle General (
-   -   Applescript to collect text from selection (

ericscheid 2013-05-15 08:44 PM

Applescript to collect text from selection
Here's an AppleScript I use to collect all the text from multiple simple objects. This is handy when I've built up a sitemap as a diagram, and want to paste just the text into a spreadsheet.

It assumes the objects are arranged layer-wise in the order you want them.

tell application id "OGfl"
tell front window
set theSelection to the selection
set numItems to length of theSelection
set theText to ""
repeat with itemNo from 1 to numItems
set theText to theText & (text of item (numItems - itemNo + 1) of theSelection) & return
end repeat
end tell
display dialog "The text:" default answer (theText as text)
end tell

All times are GMT -8. The time now is 11:00 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2022, vBulletin Solutions, Inc.