The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniGraffle General (http://forums.omnigroup.com/forumdisplay.php?f=10)
-   -   Applescript to collect text from selection (http://forums.omnigroup.com/showthread.php?t=29592)

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.

[CODE]
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
[/CODE]


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

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