Jump to content
Macro Express Forums

Simple macro opening folders fails


Recommended Posts

I want to open these 3 XP folders. But the macro freezes after opening the first one. If I interfere by clicking that folder, the macro moves to the next, etc.

 

Open Folder to "C:\Docs\Maps\Mem-Map Files"

Wait for Window Title: C:\Docs\Maps\Mem-Map Files

Open Folder to "C:\Docs\Maps\Mem-Map Files\UK\Aerial 1-25k"

Wait for Window Title: C:\Docs\Maps\Mem-Map Files\UK\Aerial 1-25k

Open Folder to "C:\Docs\Maps\Mem-Map Files\UK"

Wait for Window Title: C:\Docs\Maps\Mem-Map Files\UK

 

Yet if I delete the Waits, to give this macro, it runs OK. Can anyone suggest the likely cause please? What's wrong with those Waits (all are exact matches)?

 

Open Folder to "C:\Docs\Maps\Mem-Map Files"

Open Folder to "C:\Docs\Maps\Mem-Map Files\UK\Aerial 1-25k"

Open Folder to "C:\Docs\Maps\Mem-Map Files\UK"

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

I don't' think you need the waits. I've never tested it but I think MEP automatically waits. I have a macro that opens all of a certain folder for all the users in the office, EG All User's Startup. It doesn't happen instantly and the ones that are missing it actually takes awhile an none of the rest open until it's resolved. The reason I mention it is because maybe somehow the built in wait is messing with your wait. IE your wait for fails because by the time it started watching the window was already visible. But take that with a grain of salt because I've never tested it. But you could perform a simple test to determine this.

 

Now what kind of wait for parameters are you using and how is your Windows Explorer configured to display? And are you using Vista or XP? I know in Vista the window title isn't apparent but I believe it still 'appears' to MEP.

 

I just did a simple test on my machine below and the beep happens instantly and not after three seconds which is the max wait for period I specified. Can you try it on your machine and see what happens? And if this is working and but yours is not could you post a bit of simple sample code that demonstrates the failure to the rest of us?

<OPEN FOLDER Path="C:\\Program Files"/>
<WAIT FOR WINDOW TITLE Title="C:\\Program Files" Partial="FALSE" Wildcards="FALSE" Indefinite="FALSE" Hours="0" Minutes="0" Seconds="3"/>
<BEEP/>

Link to comment
Share on other sites

I don't' think you need the waits. I've never tested it but I think MEP automatically waits. I have a macro that opens all of a certain folder for all the users in the office, EG All User's Startup. It doesn't happen instantly and the ones that are missing it actually takes awhile an none of the rest open until it's resolved. The reason I mention it is because maybe somehow the built in wait is messing with your wait. IE your wait for fails because by the time it started watching the window was already visible. But take that with a grain of salt because I've never tested it. But you could perform a simple test to determine this.

 

Now what kind of wait for parameters are you using and how is your Windows Explorer configured to display? And are you using Vista or XP? I know in Vista the window title isn't apparent but I believe it still 'appears' to MEP.

 

I just did a simple test on my machine below and the beep happens instantly and not after three seconds which is the max wait for period I specified. Can you try it on your machine and see what happens? And if this is working and but yours is not could you post a bit of simple sample code that demonstrates the failure to the rest of us?

<OPEN FOLDER Path="C:\\Docs\\Maps\\Mem-Map Files"/>
<WAIT FOR WINDOW TITLE Title="C:\\Docs\\Maps\\Mem-Map Files" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<OPEN FOLDER Path="C:\\Docs\\Maps\\Mem-Map Files\\UK"/>
<WAIT FOR WINDOW TITLE Title="C:\\Docs\\Maps\\Mem-Map Files\\UK" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>
<OPEN FOLDER Path="C:\\Docs\\Maps\\Mem-Map Files\\UK\\OS-Explorer 1-25k"/>
<WAIT FOR WINDOW TITLE Title="C:\\Docs\\Maps\\Mem-Map Files\\UK\\OS-Explorer 1-25k" Partial="FALSE" Wildcards="FALSE" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/>

 

But as I reported earlier, it runs without the Waits anyway.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

My suspicion is that it's the combined waits, the one built in and yours are the problem. I would leave them out unless I had a problem with timing. Then if you need to TS it more start logging the folder names on top and the execution of code and see what's happening.

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...