View Single Post
Some scripts behave in one way if run from the OmniFocus scripts menu, and another if run from the OmniFocus toolbar.

global variables, in particular, conserve their value between script runs if launched from the script menu, but lose their value if run from a toolbar icon.

This is a pity, as a lot of potentially useful script behaviours (various kinds of toggles, for example) are inaccessible if you want to use the toolbar.

Here is a simple example of a script which returns different results from menu and toolbar.

Try running it a few times from the menu, and then a few times from the toolbar ...

Code:
global gtest

try
	set gtest to gtest * 2
on error
	set gtest to 1
end try

display dialog "This time value is " & gtest as string
--

Last edited by RobTrew; 2010-06-11 at 12:19 AM..