Re: REQUEST: Easy script to show number of TLI's in folder?
"JS" <[email protected]>
| Newsgroups | gmane.comp.windows.eccopro |
|---|---|
| Message-ID | <[email protected]> |
Your are welcome! As to another forum, you probably know there are two Ecco groups at yahoogroups, this one is more on the original Ecco use, where as the second one is more on technical side. Generally, questions related to the Extension (new rules, scripts, etc.) are discussed in the second group in order not to burden all users with technicalities. :) Best Regards, JS From: David Chilcott Sent: Thursday, March 13, 2014 2:48 AM To: [email protected] Subject: Re: [eccopro] REQUEST: Easy script to show number of TLI's in folder? Many THANKS JS! Awesome... I'll get a chance to noodle with the scripting this weekend. BTW, which other Ecco forum should I check out? D ;-) David Chilcott Outformations, Inc. Keep Breathing. Tell the Truth. Be Fearless. Choose Love. Embrace the Mystery. --------------------------------------------------------------------------- Email: drc-MSorM6SaYm4Aspv4Qr0y0gC/[email protected] Voice: 510.655.7122 Skype: DavidChilcott Twitter: @DavidChilcott Facebook: www.facebook.com/DavidRChilcott LinkedIn: www.linkedin.com/in/DavidChilcott Schedule a meeting with me at: http://meetme.so/DavidChilcott Need to contact me URGENTLY? Use https://awayfind.com/DavidChilcott ---------------------------------------------------------------------------- Ask me about the Outformations Agile Enterprise JumpStart http://bit.ly/AgileJumpStart ---------------------------------------------------------------------------- On Wed, Mar 12, 2014 at 1:54 PM, JS <[email protected]> wrote: There is no such function as get_folder_items(folder_id), therefore You need to take all TLI - get_tli_items() and check each TLI on whether it belongs to the folder - get_folder_value(item_id, folder_id) count the results record them into a certain item (regretfully, there is no function that can replace a part of the item text, so you need to replace it all). You can start the script manually, on file startup, by timer, or as an autoassign rule; in the latter case it will run each time you change an item in your file, but that's ok. Try to put the following as a rule into whatever folder. You will need to put in the script your_item_id, you may know it by selecting the item and running in the Expression Evaluator display(item_id). You may try the script in the Evaluator first, then you do not need the first line (starting with++). Do not forget to back up you data before playing with scripts. ++:L:/*value*/:/*condition*/ function get_folder_tli_items(folder) --this function will returns all TLIs from a given folder (id or name) --12 March 2014 t=get_tli_items() t_out={} n=0 for i,v in ipairs(t) do if get_folder_value(folder,v) >' ' then n=n+1 t_out[n]=v end --if end --for if n > 0 then return t_out end --if return 'there is no TLI in this folder' end --function a=get_folder_tli_items('Today') your_item_id= set_item_text(your_item_id, 'TLI Count= '..#a..' <- - your text here' By the way, such questions are more suitable for another group, maybe you will get more responses there. From: David Chilcott Sent: Tuesday, 11 March, 2014 18:41 To: [email protected] Subject: [eccopro] REQUEST: Easy script to show number of TLI's in folder? I'd like to implement some WIP limits for folders which would be helped by having a calculated text item (at the top for example) that shows the number of Top Level Items in that folder Is there anyone with pointers to how this might be scripted? D ;-) David Chilcott Outformations, Inc. Keep Breathing. Tell the Truth. Be Fearless. Choose Love. Embrace the Mystery. --------------------------------------------------------------------------- Email: drc-MSorM6SaYm4Aspv4Qr0y0gC/[email protected] Voice: 510.655.7122 Skype: DavidChilcott Twitter: @DavidChilcott Facebook: www.facebook.com/DavidRChilcott LinkedIn: www.linkedin.com/in/DavidChilcott Schedule a meeting with me at: http://meetme.so/DavidChilcott Need to contact me URGENTLY? Use https://awayfind.com/DavidChilcott ---------------------------------------------------------------------------- Ask me about the Outformations Agile Enterprise JumpStart http://bit.ly/AgileJumpStart ----------------------------------------------------------------------------
image.png
(image/png, 8.1 KB) - not displayed