The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniOutliner 3 for Mac (http://forums.omnigroup.com/forumdisplay.php?f=9)
-   -   Setting AppleScript variable to text of a cell (http://forums.omnigroup.com/showthread.php?t=22803)

Patrick J 2011-12-03 06:58 AM

Setting AppleScript variable to text of a cell
 
Hi

I have a very simple question.

I am creating an AppleScript which will speak the text in the currently selected cell of OO Pro. However I can't figure out how to set a variable in the AppleScript to the text of the currently selected row :)

This for example:

[CODE]tell application "OmniOutliner Professional"
tell front document
set x to text of selected row
end tell
end tell
[/CODE]

Doesn't work.

I know that the ability to speak the text of the currently selected cell is already built into OO P (Edit menu -> Speech -> Start Speaking) but I wish to perform some work on the text prior to speaking, substituting some words in the text, also I wish to be able to change the speed of the speech. So for these reasons I do wish to do this with an AppleScript.

Thank you for any help you can give.

RobTrew 2011-12-03 10:26 AM

Each row may, of course, have several different text columns, but assuming that it is the text of the topic column that you want:

[CODE]tell application id "OOut"
set strText to topic of first selected row of front document
end tell[/CODE]

Patrick J 2011-12-03 03:31 PM

Thank you
 
Thank you Rob

In fact I wished to get the text of the cell in a column which was not the "topic" :)

However with your AppleScript I was able to work this out.

I've come up with this:

[CODE]tell application id "OOut"
set strText to text of cell named "Spanish" of first selected row of front document
end tell[/CODE]

Which seems to work fine.

I'm now going to fit it into my script for speaking the text.


All times are GMT -8. The time now is 03:07 PM.

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