Need help with erasing dates in Mori

Tags ( )

Howdy,

I'm putting together a ridiculously long applescript to sync Mori and iCal, and one nut I haven't been able to crack is the ability to erase a date value -- set it to "missing value". For instance, the script may need to remove a due date that was previously set.

Any suggestions? Script is below.

Thanks,
Mark

tell application "Mori"
tell front document
set theEntry to entry named "Buy food"
set note of theEntry to "Quickly!"
set note of theEntry to missing value
--this works
set due date of theEntry to current date
set due date of theEntry to missing value
--this doesn't
tell theEntry to store custom attribute key "Completed" value current date
tell theEntry to store custom attribute key "Completed" value missing value
--neither does this
end tell
end tell

null

Try:

set due date of theEntry to null

That doesn't seem to work,

That doesn't seem to work, it gets the error "Mori got an error: Can't make null into type date.". It's a similar story when using "missing value".

Does anyone know how this works in other programs? Please point me to a program that has a date property that can be set to null and I'll look at the program and figure out how to add that capability to Mori.

Thanks for any help.

Not just for dates

I get the same result when storing "missing value" into text fields as well, so this behavior is not apparently restricted to date fields.

I'm not sure how other apps do this -- I've basically cobbled my script together from the stolen fragments of dozens of others -- but it seems that this works (meaning setting a date or text field to "missing value") with iCal, for one.

- Mark

Comment viewing options

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