Applescript help
Michael Grant
soft at bdanube.com
Fri Nov 21 16:15:35 PST 2003
On Nov 21, 2003, at 4:33 PM, Jon Muller wrote:
> Ok. So my proposed solution was to create a new column to the left of
> the paragraphs and fill it with check-off boxes. There is no
> parent-child link to these boxes so I am free to check whatever I
> want. The new column is titled "Print".
>
> The problem is that I know virtually nothing about Applescript and do
> not know how modify the above script to look at the checkboxes in the
> Print column, instead of the "state" checkboxes. Any of you
> Applescript whizzes out there know if this can be done and what should
> be added to make it work?
Something along the following lines should do it (untested as such but
simplified from a functioning script I run here):
/////
tell application "OmniOutliner"
-- Identify "Print" column:
-- this section enables you to rearrange columns,
-- but will cause your script to fail
-- if you delete or rename the "Print" column.
tell document 1
repeat with i from 1 to (count of every column)
if the title of column i is "Print" then
set checkCol to i
exit repeat
end if
end repeat
end tell
-- Now loop through all the rows:
repeat with aRow in (every row of document 1)
-- The if statement works for
-- both checked and mixed-state checkboxes:
if the value of cell checkCol of aRow is greater than 0 then
-- Do your print routine here
end if
end repeat
end tell
/////
Michael
--
Around the year 2005, a sudden spark will catalyze a Crisis mood.
Remnants of the old social order will disintegrate. [...] Americans
will share a regret about recent mistakes--and a resolute new consensus
about what to do. [...] Sometime before the year 2025, America will
pass through a great gate in history, commensurate with the American
Revolution, Civil War, and twin emergencies of the Great Depression and
World War II.
- William Strauss and Neil Howe, The Fourth Turning, 1997
More information about the OmniOutliner-Users
mailing list