AppleScript questions
Nicholas Riley
njriley at uiuc.edu
Fri Aug 22 08:26:08 PDT 2003
Hi,
I'm trying to write some AppleScripts for OmniOutliner in order to
automate some of the project management work I do in it.
The first script I've had problems with is one that inserts the date,
either in the current row or below the current row if there's already
text in that row. This is what I have so far:
tell front document of application "OmniOutliner"
local theDate, theRow
set theDate to (do shell script "date '+%A, %e %B %Y'")
set theRow to selected row
if theRow's topic is "" then
set theRow's topic to theDate
else
set selected row to (make new row at end of children
of theRow's first parent with properties
{topic:theDate})
end if
end tell
There are several problems with this script which I'd ideally like to
resolve:
- In the first case where the topic is empty, the topic doesn't appear
until I manually move somewhere else in the outline.
- In the second case, I'm not able to create a row below the current
row. I tried "make new row after theRow" but that didn't work; I got
one of those completely useless Cocoa script error messages. The
object specifier for theRow seems to contain the information I need,
specifying what child # it is, but 'index of theRow' doesn't give me
anything useful and I can't figure out another way to dissect it.
- The font of any script-set topic is Helvetica. As much as I like
Helvetica, I would prefer that the items follow the standard styles of
the outline (how I wish for the flexibility of MORE's rules, but
that's another rant :) The only workaround I can think of is to use UI
Scripting to pick the 'copy style' and 'paste style' commands from
menus, but there has to be a better way...
Thanks for any hints,
--
=Nicholas Riley <njriley at uiuc.edu> | <http://www.uiuc.edu/ph/www/njriley>
Pablo Research Group, Department of Computer Science and
Medical Scholars Program, University of Illinois at Urbana-Champaign
More information about the OmniOutliner-Users
mailing list