Get Mori entry by ID & other AS trouble

Tags ( )

I'm working on an AppleScript script and I want to be able to retrieve Mori entries by ID (in case there is more than one entry with the same name, which would cause trouble using entry named "name"). Is there any way to do this other than searching every entry to find it?

Also, I'm trying to set the checkbox state of an entry by set (entry named aTodosName)'s checkbox to on state inside a Mori tell block but this always gives me the error: "Mori got an error: Can't make checkbox of entry "check mail" into type reference." ("check mail" is just the name of the entry being tried). Any thoughts on why this is; I've never had trouble with checkboxes before (other than when the name changed in 1.2).

When mGTD still just an

When mGTD still just an Applescript (a very long one at that,) I used:

set thisEntry to entry id eachID

(where eachID is an integer, and "entry" and "id" are resevered words for Mori)

to avoid problems with duplicate names.

I don't think I can help you with the other. One thing to check is that all method blocks have a "using terms from application "Mori"" block in them. I think that used to give me reference errors.

Thanks. That works for the

Thanks. That works for the first issue.

As for the second, here's the full line from the script:

tell application "Mori" to set checkbox of entry id entryID to on state

This produces the same error as before (although now it shows an id number rather than a name). As is often the case with AppleScript, everything seems fine, so I'm not sure what's missing.

Gordon, Here's some script

Gordon,

Here's some script that works for setting the checkbox of an entry fetched by id. Can you send full examples of the scripts that are not working?

tell application "Mori"
tell front document
set checkbox of entry id 3 to on state
end tell
end tell

Jesse, the tell front

Jesse, the tell front document is what I was missing. I had typed it earlier, but I'm several levels deep in the code and inside another application's tell block, so I forgot that although I was still inside a "tell front document" block, it was no longer applying.

Thanks.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.