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!
|
|
FAQ | Members List | Calendar | Today's Posts | Search |
Populate Template Placeholders, 0.6.1 | Thread Tools | Search this Thread | Display Modes |
Guest
2009-07-02, 11:17 AM
Post 11
|
Not sure if this is a bug or just an inconsistency. Here's a script that demonstrates the issues (which I'll also send to the ninjas):
Code:
(* Run this script with one of the built-in sidebar items selected (e.g. No Context or Context in context mode, or Inbox or Library in planning mode). The fourth set will yield an error. Run it again with a project, context, or folder selected and everything is fine. In the first case, bar is set to something like: value of tree 2 of sidebar of document window id 60308 of document id "jwv2Yzh3ZwG" In the second case, bar is set to something like: project id "o-8rLx0w-T7" of document id "jwv2Yzh3ZwG" (To see this, run the script from Script Editor with the Event Log showing.) *) tell application "OmniFocus" tell document 1 tell document window 1 set foo to item 1 of selected trees of sidebar set bar to value of foo set blah to name of foo set baz to name of bar -- unexpected error end tell end tell end tell Another inconsistency is that the sidebar in context mode doesn't have properties for No Context and Contexts, which it seems like it might in analogy with planning mode.
__________________
Cheers, Curt
Post 12
|
Member
2009-12-06, 12:08 PM
How would I modify the script so that the new project appears in the same folder as the template? For me it would be very helpful to set things up this way, because I'd like to keep the templates in the appropriate folders, (instead of putting them in a template folder).
Thanks in advance. --Henri
Post 13
|
Quote:
Code:
duplicate (value of item 1 of theSelectedItems) to after last section set duplicatedItem to last section
__________________
Cheers, Curt
Post 14
|
Member
2009-12-06, 08:12 PM
Quote:
--Henri
Post 15
|
Member
2009-12-07, 06:31 AM
Here is what I tried. It seems the first line works, but the second doesn't:
Code:
duplicate (value of item 1 of theSelectedItems) to after selectedItem set duplicatedItem to item after selectedItem
Post 16
|
Henri,
I'd have to implement it myself to get the second line exactly, and I'm afraid time doesn't permit that right now. You might try something like: Code:
set duplicatedItem to item 1 of following siblings of selectedItem Cheers, Curt
__________________
Cheers, Curt
Post 17
|
Member
2009-12-07, 08:41 PM
Success! It turned out to be easier than I thought, once inspiration struck:
Code:
set duplicatedItem to selectedItem Anyway, this is an awesome script! It saves a lot of work entering dates. Thank you so much. --Henri
Post 18
|
Doh! <slapsHead />
Very elegant. Nicely done. Cheers, Curt
__________________
Cheers, Curt
Post 19
|
Member
2009-12-19, 06:15 AM
One more refinement to this super-useful script: anyone (Curt?) know how to change the review frequency of a project via scripting? As it stands now, my defaults are to review templates every three months, and projects every three weeks. I'd love to change that property of a project accordingly after I've created it with this script.
Post 20
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Populate Template Placeholders script Not filling placeholders | Tim1 | OmniFocus 1 for Mac | 2 | 2013-03-11 03:32 PM |
Adding Due and Start Dates for Populate Template Placeholders | jessicatmt | OmniFocus Extras | 1 | 2012-08-06 10:05 PM |
'Populate Template Placeholders' could not complete. | Solana | OmniFocus 1 for Mac | 5 | 2012-03-21 09:53 AM |
Curt Clifton's Populate Template Placeholders | bcap | OmniFocus Extras | 1 | 2011-02-17 09:31 PM |
Populate Template Placeholders Script problem | Danoz | OmniFocus Extras | 8 | 2007-09-11 03:34 AM |