droodled Posted October 30, 2014 Report Share Posted October 30, 2014 Dear All,Percent characters are used as variable identifiers within macro express.I'm experiencing problems in creating/deleting/renaming/copying/moving files and folders containing multiple % characters somewhere in their path/name.I've found 2 relevant threads, but the techniques used in there don't work when creating/deleting/renaming/copying/moving files and folders, because variables are evaluated in these commands.Therefore if I come across a path, a path with a filename, or a filename, containing more ten 1 % character, a "Variable Not Set or Incorrect Variable Type" error occurs.Example of such path with filename:d:\801% SampleDVD\SubFolder1\SubFolder2\80% SampleDVD%.mp4I've tried using the split command to assure only 1 % character, but as soon as I compile the complete path again, and start doing whats needed with the file or folder, the error's back. I've tried doubling the percent character, so %%, instead of %. I can't find it anymore, but I remember reading somewhere that the % characters will then be interpreted as character, not variable. Unfortunately also no go.I've also tried renaming files and folders, by replacing the % character with something else. In itself that works, but going back again later to the original name will again cause errors. Apart from that, I couldn't find a way around the possibility of 2 % characters in a filename or foldername, e.g. "80% SampleDVD%.mp4".-How do you people deal with this, might you have some ideas?Thanks and best regards, Quote Link to comment Share on other sites More sharing options...
Samrae Posted October 30, 2014 Report Share Posted October 30, 2014 What version of Macro Express Pro are you using? With version 4.3.0.1 some of the commands were modified with the option "Don't process embedded variables". If you post a snippet of your code we may be able to make some better suggestions. Quote Link to comment Share on other sites More sharing options...
Cory Posted October 30, 2014 Report Share Posted October 30, 2014 I assume the percents in file names are extant and can not be anticipated. What command are you having a problem with specifically? For instance I just created a file named "Some %UndefinedVariable% Again.txt" and stuck it on the desktop and executed a Repeat with Folder command coupled with a Text Box Display in the loop of see each file and it work fine. Repeat with Folder C:\Users\Cory.BD\Desktop Text Box Display: Test End Repeat I suggest you create a simple macro that demonstrates the problem and post it here for us to test ourselves. Quote Link to comment Share on other sites More sharing options...
Cory Posted October 30, 2014 Report Share Posted October 30, 2014 Oops. I'm an idiot. I didn't see you specified the operations in your subject. I was looking in the message. Hmmm... I see your problem. Quote Link to comment Share on other sites More sharing options...
Cory Posted October 30, 2014 Report Share Posted October 30, 2014 Looking only at the rename command I can't figure out a way to do it within MEP. No matter how one gets the name as long as you use the MEP Rename command it will attempt to evaluate variables in the extant file name. I can think of several ways to do it with external scripts or whatever but not from within MEP. It seems to me that the file manipulation commands need an option not to process embedded variables as well. Don't forget you can at least catch this error and handle it. Maybe make an external script that will fix that file name for you. You know we have had this problem before and I appreciate the option not to process embedded variables but I wonder if at times we need a hybrid. That is to processes embedded variables only if they exist and otherwise ignore. I think I'll make that suggestion officially at the ISS site. Quote Link to comment Share on other sites More sharing options...
droodled Posted October 31, 2014 Author Report Share Posted October 31, 2014 Thanks Cory, I was afraid of this already, and am now looking into creating a DOS batch file to rename/restore folder/file names again. I hadn't given it a serious go, because from the several thousands of folders/files, it's only about 319 that need this treatment. To much to do it manually though. It's a good idea though to use that in the catch error part, thanks for that. I hadn't thought about that to be honest, as I try in general to be ahead of problems, not to react to them. It often makes things overly complicated for me, but I learn from that. I'll give that a go as well. As you wrote though, not to process embedded variables if they don't exist, would in my opinion be the 1 that would solve most of the problems experienced, if not all. It shouldn't be too difficult to implement as well. Best regards, Quote Link to comment Share on other sites More sharing options...
droodled Posted November 3, 2014 Author Report Share Posted November 3, 2014 Solved it by creating and executing a batch file in the "On error/Catch error" part when creating/deleting/renaming/copying/moving files and folders with cases where the % character is causing problems. Thanks for the idea Cory. Best regards, Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.