Getting started with scripting

Daniel Brogan danb at 5280.com
Tue Jan 29 16:39:02 PST 2002


Greg,

Sorry for the delay in responding. Deadlines intervened.

I tried your script but ran into a couple of problems. As is, it complained
the "the variable diary is not defined" (even though it was declared earlier
in the script. I tried changed the variable to an absolute reference:

make new item at end of items of document named "Completed Tasks" with
properties {text:dateString}

And I get the error:

--> OmniOutliner got an error: NSInternalScriptError

Any thoughts?

-Dan
    
On 1/25/02 2:25 AM, "Greg Titus" <greg at omnigroup.com> wrote:

> 
> On Thursday, January 24, 2002, at 09:57  PM, Daniel Brogan wrote:
> 
>> It's been a while since I've done any AppleScripting. Can anyone tell
>> me if
>> the following is possible, and, if possible, help me get started?
>> 
>> I'd like to write a script that will select all of the checked items in
>> my
>> to do list, gather them under a headline with the current date, and then
>> move them to a separate completed items outline. The resulting outline
>> will
>> give me a diary of what got done when.
>> 
> 
> Hi Dan,
> 
> The following will do pretty much what you are asking for. I'm
> revisiting the AppleScript support for the eventual OmniOutliner 2.0
> right now, so if you (or anyone else) has any suggestions for
> terminology, or things you'd like to be able to do with Outliner and
> AppleScript, or even ideas for scripts that you'd like to be included as
> examples (like this one - this is a great idea!), I'd love to hear about
> them.
> 
> tell application "OmniOutliner"
> -- set up some variables
> set original to front document
> set diary to document named "Diary.ooutline"
> set today to current date
> 
> -- format today's date in an appropriate way
> set dateString to month of today & " " & day of today & ", " & year
> of today as string
> 
> -- create the entry in the diary
> make new item at end of items of diary with properties
> {text:dateString}
> 
> -- move the checked items
> move (every item of original whose state is "checked") to end of
> children of last item of diary
> end tell
> 
> This could be fleshed out quite a bit more (for example, if your diary
> isn't already open, finding it and opening the document for you), but
> it's a good minimal script to do what you need.
> 
> Hope this helps,
> --Greg
> 




More information about the OmniOutliner-Users mailing list