Re: REQUEST: Easy script to show number of TLI's in folder?

"JS" <[email protected]>
Newsgroups gmane.comp.windows.eccopro
Message-ID <0ABEE71973C84095A13A0E52A71D7018@VoldemarsTHINK>
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: [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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.