Beaue Posted February 21, 2013 Report Share Posted February 21, 2013 Hi Guys, I've been running into an issue with a couple of lines of script. I've tried two different ways of doing this and my macro keeps stalling at this step every other time I run it. I will run the macro once and it will work, then it will stall the 2nd time through, then work the third. It's really boggling. The entire script repeats on a loop determined by a variable at the beginning of the script. It copies a Lotus Notes ID file from an attachment in an Outlook email to a network drive that the script previously mapped, this is where it stalls. The script succeeds in saving the .ID file to the network drive every time. Afterwards, it i supposed to wait for the file to exist on the network drive and then proceed. The problem is that it's not proceeding. I have to manually cancel the macro, and the next time I run it, it works fine. I have even deleted the .ID file from the network drive as a troubleshooting step to basically "reset" the script to run as if it hadn't done anything yet. I wanted to see if it just wasn't refreshing the network drive to look for the file, but the script still functions fine when I run it again. I know the problem happens in this section of the script because I have the dialogue box set to tell me what line it was canceled on (as a side note, it is quite annoying that the "Don't show this again" box is ticked by default, making it so that I have to untick it every time). Anyway, I've tried the simple "Wait For File To Exist" command: <WAIT FOR FILE TO EXIST Filename="%Path%" Indefinite="TRUE" Hours="0" Minutes="0" Seconds="0"/> <COPY FILE/FILES Source="%Path%" Dest="%Path%" Progress="TRUE" Recurse="FALSE"/> and the slightly more complicated "infinite loop until file exists" script: <REPEAT UNTIL Variable="%T%" Condition="\x01" Value="%T%"/> <DELAY Flags="\x02" Time="500"/> <IF FILE EXISTS File="%Path%" Search_Path="FALSE"/> <REPEAT EXIT/> <END IF/> <END REPEAT/> <COPY FILE/FILES Source="%Path%" Dest="%Path%" Progress="TRUE" Recurse="FALSE"/> In an earlier version of this script I was merely using Z:\%ID%.ID as the path, where %ID% was the filename (I had to add the extension .ID to it because they weren't saving as ID files) but it wasn't saving at all until I started setting the entire path and file name to the variable %Path%. I guess it didn't like embedded variables or something. Anyway, in both scripts above, I can see that the file exists, yet the script will not proceed beyond this point. It is copying the filename directly from the file and saving it to a variable before it saves it to the Z: drive, so it's not an issue of syntax or spaces in the name (and if it were, it shouldn't work the 2nd time I run the script either). Anyone have any ideas as to a fix or the root issue? Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.