OF3 Refresh due date with AppleScript

Hello,

I have a very simple AppleScript that changes the due date of an item and it works just fine, except for one thing. It shows the change on the inspector, but not on the main view of the task.

What the script does is change the due date of an item:

tell application "OmniFocus"
	tell default document
		set due date of OFTask to TaskDueDate
	end tell
end tell

Where OFTask is the task in OF, and TaskDueDate is the new due date of the item that I want to change via AppleScript.

The following image shows you the problem:

Any ideas on how to refresh the main view with AppleScript? The update needs to happen because the task may be visible to the user (even if not actively selected). When the task is not visible, the task changes without problems.

Thanks.

This may be irrelevant/another case altogether: I often notice that when I have a list of tasks in the left hand window of a Project and update one or more of them in the Inspector (e.g. by clicking on ‘+1 day’), the task’s date(s) don’t get updated.

So it may not be your script, @mbust, which is failing - but a small bug in OF itself.