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 > OmniPlan > OmniPlan Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
rb-appscript examples Thread Tools Search this Thread Display Modes
Hi Guys,

I'm evaluating OP at the moment and need to automate pushing data in out. I need to use ruby for this since ultimately I want to hook it into a Rails app.

Could you provide some rb-appscript based examples as I'm struggling a bit at the moment. An example that first gets the % completed values then puts them back with a revised value would be wonderful. :) An example that adds new asks would also be useful.

Best Regards,

Carl
 
Quote:
Originally Posted by Carl Bourne View Post
Hi Guys,

I'm evaluating OP at the moment and need to automate pushing data in out. I need to use ruby for this since ultimately I want to hook it into a Rails app.

Could you provide some rb-appscript based examples as I'm struggling a bit at the moment. An example that first gets the % completed values then puts them back with a revised value would be wonderful. :) An example that adds new asks would also be useful.

Best Regards,

Carl
I can't give rb-appscript code, but I can share a simple AppleScript to do something similar:

Code:
tell application "OmniPlan"
	-- Note:  Inspector has "" as its name, and is often the front!
	set frontWindow to front window where name is not ""
	set selTasks to selected tasks of frontWindow
	repeat with curtask in selTasks
		set completed of curtask to 1.0
	end repeat
end tell
This iterates across each selected task in the front window (excluding the Inspector window), setting the "completed" value to "1.0". In other words, it lets me mark a bunch of tasks as "done" with a single click instead of going into the inspector to change the % Completed field to "100".

Similarly, you could do more complicated math on the current value of "completed of curtask" before setting it back again.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Appscript to delete project Gambusia OmniFocus 1 for Mac 0 2010-08-07 07:57 AM
Some examples Alan B OmniOutliner 3 for Mac 2 2009-05-07 03:47 AM
setting Text properties using Ruby appscript or RubyOSA Joe.Hocker AppleScripting Omni Apps 1 2009-02-14 12:20 AM
Help/Examples Applescript pslade OmniPlan General 3 2007-08-06 12:33 PM
AppleScript examples? ppc970 OmniPlan General 1 2006-07-27 02:47 PM


All times are GMT -8. The time now is 06:18 PM.


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