The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus 1 for Mac
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
Some OmniFocus Scripts Thread Tools Search this Thread Display Modes
Quote:
Originally Posted by Keith
The "Add OmniFocus Action" script did nothing for me until I deleted the "on assistiveDevicesSupportEnabled()" by revising it to automatically return a "true" result:

on assistiveDevicesSupportEnabled()
-- check to see if assistive devices is enabled
return true
end assistiveDevicesSupportEnabled

It seems to have been choking on the "set UI_enabled to UI elements enabled" line. Now it works fine. (I already had assistive devices enabled, of course; could it have made a difference that I am running the Finder and all my other programs in Japanese?)
Thanks for that report. I suspected that non-English localizations might be affecting that code. It's a bit surprising though, since that code is based on an example provided by Apple.

Quote:
Originally Posted by Keith
As for the "Open Linked Mail Message" script, it works when I run it from the Script menu or from ScriptEditor, but not when I run it by clicking it in the OmniFocus toolbar. Odd.
That is odd. It works fine from the toolbar for me. Have you tried restarting OmniFocus?
__________________
Cheers,

Curt
 
Quote:
Originally Posted by curt.clifton
That is odd. It works fine from the toolbar for me. Have you tried restarting OmniFocus?
Thank you, yes, I have tried restarting. Puzzling, the script is running from the toolbar, it just isn't doing anything. When I click the script in the toolbar with nothing selected, I do get the "You must first select a project or action" message, so the script is definitely running. But when I select a project or action and click the toolbar, it doesn't seem to cause Mail to do anything.

A more significant problem (for me, anyway): the script does not recognize which window has the focus. I have three OmniFocus windows open on three monitors, but it seems that the "Open Linked Mail Message" script will only ever work in one window, namely, the first window opened when the program is launched (although if the other two windows are closed, then it becomes possible to run the script in the sole remaining window, even if it was not the first window opened when the program was launched). Even if the foremost window (the window with focus) contains a selected project or action, the script will act only based upon the selection (or lack of any selection) in the window which it believes has the focus, i.e., the first window opened when the program was launched.

In the script I tried changing "tell document window 1" to "tell front document window" but it didn't have any effect.
 
Quote:
Originally Posted by Keith
Thank you, yes, I have tried restarting. Puzzling, the script is running from the toolbar, it just isn't doing anything. When I click the script in the toolbar with nothing selected, I do get the "You must first select a project or action" message, so the script is definitely running. But when I select a project or action and click the toolbar, it doesn't seem to cause Mail to do anything.
The script is very likely triggering an error, which is swallowed by OmniFocus. To check, follow these steps:

1. When you get a situation where the script appears to do nothing, leave OmniFocus alone so that selections and focus don't change.
2. Open the script in Script Editor and run it from there.
3. Note any errors messages that are displayed.

Quote:
Originally Posted by Keith
A more significant problem (for me, anyway): the script does not recognize which window has the focus. I have three OmniFocus windows open on three monitors, but it seems that the "Open Linked Mail Message" script will only ever work in one window, namely, the first window opened when the program is launched (although if the other two windows are closed, then it becomes possible to run the script in the sole remaining window, even if it was not the first window opened when the program was launched). Even if the foremost window (the window with focus) contains a selected project or action, the script will act only based upon the selection (or lack of any selection) in the window which it believes has the focus, i.e., the first window opened when the program was launched.

In the script I tried changing "tell document window 1" to "tell front document window" but it didn't have any effect.
That sounds like an OF bug. I've reproduced it and reported it.
__________________
Cheers,

Curt
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Scripts for Integrating OmniFocus with DEVONthink 2 RobTrew OmniFocus Extras 73 2014-05-09 07:09 AM
OmniFocus bought thru AppStore: Cache-querying scripts fail RobTrew OmniFocus Extras 1 2011-06-29 03:38 PM
Scripts- Greasemonkey Scripts cjwworld OmniWeb General 5 2010-12-24 02:59 AM
Adding scripts to OmniFocus roontoon OmniFocus Extras 1 2010-10-07 12:06 PM
OmniFocus scripts would benefit from a "has subtasks" property RobTrew OmniFocus Extras 0 2010-06-09 03:37 AM


All times are GMT -8. The time now is 09:10 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.