Jump to content
Macro Express Forums

Count files in FOlders and display them


Recommended Posts

Created some counts in Folders

But what i need is a little bit more. Maybe you can help me for this.

 

Ok i created a FileCount.

 

<VARIABLE SET INTEGER Option="\x00" Destination="%FileCount%" Value="0"/>

<REPEAT WITH FOLDER Path="F:\\Eigene Dateien\\Eigene Bilder" OnlyFiles="TRUE" Destination="%MyStr%" FullPath="FALSE" ProcSubfolders="FALSE"/>

<VARIABLE MODIFY INTEGER Option="\x07" Destination="%FileCount%"/>

<END REPEAT/>

<IF VARIABLE Variable="%MyStr%" Condition="\x03" Value="2" IgnoreCase="FALSE"/>

<TEXT BOX DISPLAY Title="Eigene Dateien" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1031{\\fonttbl{\\f0\\fnil Tahoma;}{\\f1\\fnil\\fcharset0 Tahoma;}}\r\n{\\colortbl ;\\red128\\green0\\blue0;}\r\n\\viewkind4\\uc1\\pard\\qc\\cf1\\b\\f0\\fs40 %FileCount%\\f1 Files in Eigene Dateien\\cf0\\b0\\f0\\fs16 \r\n\\par }\r\n" Left="Center" Top="Center" Width="567" Height="145" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x00" Delay="0"/>

<VARIABLE SET STRING Option="\x00" Destination="%T[1]%" Value="A" NoEmbeddedVars="FALSE"/>

<MULTIPLE CHOICE MENU Style="\x00" Result="\x00" Dest="%T[1]%" Title="Auswahl" Prompt="%FileCount% Files in Eigene Dateien" Options="&1 Anzeigen\r\n\r\n\r\n&2 Ende\r\n" Left="Center" Top="Center" Monitor="0" Width="292" Height="226" OnTop="FALSE"/>

<IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="A" IgnoreCase="FALSE"/>

<PROGRAM LAUNCH Path="C:\\Program Files (x86)\\ACDSee32\\ACDSee32.exe" Mode="\x00" Parameters="f:\\Eigene~1\\eigene~1" Default_Path="FALSE" Wait="1" Get_Console="FALSE"/>

<ELSE/>

<IF VARIABLE Variable="%T[1]%" Condition="\x00" Value="D" IgnoreCase="FALSE"/>

<END IF/>

<END IF/>

<END IF/>

 

this works fine but now comes the difficult problem. I want to show it but not in a Text box.

There are several possibilities but i do not know what works and what not.

 

So

Possibility 1 (like most)

can place a icon in the taskbar who tells me how many files are in the folder

 

but i think this can not work (i had a program named samurize there it worked but samurize will not run under Win 7 64 bit in the taskbar)

2.

this could maybe work and will be ok for me

changed an icon in the taskbar depending of how many files are in the folder ( means if there are 50 files the icon changed to lets say 50.ico and if there are 1000 it will change to 1000.ico or similiar.)

if this will not work in the taskbar maybe it can work on the desktop?

 

help would be great

Link to comment
Share on other sites

My suggestion was that the if you want an item to appear in the task bar you could create a text box “Floating box until close or end of macro” command instead. This requires the macro be running all the time. I would imagine if you wanted to check every 10 seconds you put your macro in a perpetual loop with a 10 second delay. If the count changes use the “Text box close” command and then re-open. Then in the Header field include your count variable. Now you will always have an icon in the task manager that displays the number of files in that folder.

 

Now if you wanted to get a little more clever I’d suggest two macros. One as a trigger and another as a count and display like you have. This way you could use the Directory Modification activation with the Create, Rename, or Delete a file option. This way it would only update that text box when the contents of the folder changed.

Link to comment
Share on other sites

Hi

ok i understand the thing with the loop. but i need help .A 15 or 30 minutes loop would be ok for me. So i should also not need the second macro.

I think i can forget to click on the box to open the folder but i can live with that.

But what i do not understand is how to set it up with an icon in the taskbar.

 

so here is the macro again - any chance you can help with loop and with the taskbar?

 

<VARIABLE SET INTEGER Option="\x00" Destination="%FileCount%" Value="0"/>

<REPEAT WITH FOLDER Path="F:\\Eigene Dateien\\Eigene Bilder" OnlyFiles="TRUE" Destination="%MyStr%" FullPath="FALSE" ProcSubfolders="FALSE"/>

<VARIABLE MODIFY INTEGER Option="\x07" Destination="%FileCount%"/>

<END REPEAT/>

<IF VARIABLE Variable="%MyStr%" Condition="\x03" Value="2" IgnoreCase="FALSE"/>

<TEXT BOX DISPLAY Title="Eigene Dateien" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1031{\\fonttbl{\\f0\\fnil Tahoma;}{\\f1\\fnil\\fcharset0 Tahoma;}}\r\n{\\colortbl ;\\red128\\green0\\blue0;}\r\n\\viewkind4\\uc1\\pard\\qc\\cf1\\b\\f0\\fs40 %FileCount%\\f1 Files in Eigene Dateien\\cf0\\b0\\f0\\fs16 \r\n\\par }\r\n" Left="Center" Top="Center" Width="567" Height="145" Monitor="0" OnTop="FALSE" Keep_Focus="TRUE" Mode="\x02" Delay="0"/>

<VARIABLE SET STRING Option="\x00" Destination="%T[1]%" Value="A" NoEmbeddedVars="FALSE"/>

<END IF/>

Link to comment
Share on other sites

Ok!

I tried it since yesterda - and i really have no clue how to do this.

 

Problems are i am too dumb to really look behind all those variables and my english is not the best so i do not understand some of the help files.

 

So please please help!!!

I do not know how to

1. make that loop permanent ( i only can set it up for x times)

2. f the count changes use the “Text box close” command and then re-open - maybe i can do this with a "if" "than" rule but i can do that only if i can set up the first thing

3. how do i place all this into the taskbar or tray???????? Must i create a popup macro? and if yes - is it a process event or a floating menu ??????

 

Please help!

 

I can understand that you(who ever) do not want to write all of that code for me - and i am really willing to learn - but i need a lot of hints so i can walk through that jungle!

Link to comment
Share on other sites

To create an infinite loop you can do a repeat until X does not equal X.

 

When you create the text box you can minimize it so that it only appears in the taskbar.

 

I don’t think you understand that I’m describing putting the variable in the title. In the example below the macro counts up to 5 with 2 second delays. Watch the title of the window in the task manager and notice how the count increases. Not ideal as I don’t like having ot open a window and then minimize it like this but it does work.

<REPEAT START Start="1" Step="1" Count="5" Save="TRUE" Variable="%C%"/>
<TEXT BOX DISPLAY Title="Count: %C%" Content="{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang1033{\\fonttbl{\\f0\\fnil\\fcharset0 Tahoma;}{\\f1\\fnil Tahoma;}}\r\n\\viewkind4\\uc1\\pard\\f0\\fs16 You shouldn't see this\\f1 \r\n\\par }\r\n" Left="Center" Top="Center" Width="278" Height="200" Monitor="0" OnTop="FALSE" Keep_Focus="FALSE" Mode="\x02" Delay="0"/>
<WAIT FOR WINDOW TITLE Title="Count: %C%" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<WINDOW MINIMIZE Option="\x01" Title="Count: %C%" Partial="TRUE" Wildcards="FALSE" _IGNORE="0x0006"/>
<DELAY Flags="\x01" Time="2"/>
<TEXT BOX CLOSE Header="Count: %C%"/>
<END REPEAT/>

Of course I’m not sure how you have your task bar configured. It is possible it’s configured not to display window titles. Personally I opt not to group the icons unless it fills up.

 

Also you can modify this text box to not be minimized, shrink it, and discreetly display it in the corner of your screen and set it to be always on top.

 

I am available for hire as well. Most often teaching the tricks to my clients so they can manage their own macros later.

Link to comment
Share on other sites

Hi and thanks - sorry was very busy so i cant answer so far.

Ok so

1. i am with you that a always running macro.

As i said somwhere above - i just need to run it all 15 minutes or so just to renew and see how many files are inside. I do not need the macro permanent running. I want to see "oh there are 200 files inside" and maybe after 2 hours that there are 220 or so.

so a scheduled macro wo is running all 30 minutes or so is absolutely ok for me.

 

and i also do not group the icons. so it should work.

 

so all i must do is make my macro and put it into the tray (minimized)

but

if it is open the macro is still running wright?

so i must have it running the whole time

 

or is there a other way to do this so the macro just runs all 30 minutes?

 

and

 

2.

if i minimize it to the tray ........... i do not see the number of files - just the macro express icon - so what am i doing wrong?

Link to comment
Share on other sites

  • 3 weeks later...

Just wanted to tell you that i found a easy way.

 

I created the macro to count the files - for 5 folders and placed them all in one text box.

After the box appears a new macro started where i can choose the folder i want to open

so i see where are the files and have the chance to open it in a simple click

 

beter than run a macro all the time

 

 

thanks for your help - without i would never come so far.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...