I am having a problem with the MoveFile> command.
The problem is that if the file that I am trying to rename is already a long-file-name, which they always will be, the macro works 1 out of every 2. Take a longfilenameaverylongnamesolongitsridiculous.tif for example, and run the macro and it will rename it to longfile.tif the good-old 8.3 from DOS. Anyone knows if this is a problem with the MoveFile> command? if it is limited to 8.3 to rename? If I give it a 8.3 file it will always work.
My output files will be Section 1 - 1 Sided - Cover.tif
The files are originally called Scanjob_20030415_152529.tif
This is what my macro looks like, not exactly, but this is the part where it renames.
Input>file,Find File to Rename
Input>sect,Enter Section Number (Enter #)
Input>side,Enter Single Sided or Double (Enter #)
MoveFile>%file%,Section %sect% - %side% Sided - Cover.tif
I know that if I run the macro twice, then I have NO PROBLEMS. But, that's not what I want to do.
MoveFile Issue
Moderators: JRL, Dorian (MJT support)
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Just a thought:
I don't see any reference to the file paths for source and destination.
You may also need to do IfFileExists> after doing Input>, before doing MoveFile> to make no typo was made. Suppose the filename has been Inputted wrong and it doesn't exist? When MoveFile> runs you get no warning or indication of an error. All looks good to the user.
You may also want to do IfFileExists> after the move on the Destination File to verify Move worked OK.
I don't see any reference to the file paths for source and destination.
You may also need to do IfFileExists> after doing Input>, before doing MoveFile> to make no typo was made. Suppose the filename has been Inputted wrong and it doesn't exist? When MoveFile> runs you get no warning or indication of an error. All looks good to the user.
You may also want to do IfFileExists> after the move on the Destination File to verify Move worked OK.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
I think you may need to add double quotes for long filenames, especially if there might be spaces?
Like this:
Run Program>cmd /c move "c:\my directory\blablabla.tif" "c:\otherdirectory\longfilename averylongname solongitsridiculous.tif"
Like this:
Run Program>cmd /c move "c:\my directory\blablabla.tif" "c:\otherdirectory\longfilename averylongname solongitsridiculous.tif"
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!