Question about GetNewestFile

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

Question about GetNewestFile

Post by gchichester » Mon Feb 08, 2016 2:24 pm

It it normal for the Result Var of GetNewestFile command to include the complete path and not just the file name?
Thank you in advance for all your help
Gil

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Question about GetNewestFile

Post by JRL » Mon Feb 08, 2016 7:33 pm

Seems to be the norm. Use ExtractFileName> to extract the name sans the path.

Code: Select all

GetNewestFile>%temp_dir%*.txt,vFile
ExtractFileName>vFile,vFileName

gchichester
Pro Scripter
Posts: 132
Joined: Mon Dec 22, 2008 4:56 pm
Location: St Augustine FL

Re: Question about GetNewestFile

Post by gchichester » Mon Feb 08, 2016 8:43 pm

JRL,
Thanks for your answer, but still having problem with this simple script

Also can you please tell me why the [Code] [/Code] does not work for me?

[code]GetNewestFile>C:\Alldocs\*.Docx,strNewFile
ExtractFileName>strNewFile,NewFile
MessageModal>NewFile
CopyFile>NewFile,C:\OldDocs\NewFile[/code]
Thank you in advance for all your help
Gil

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: Question about GetNewestFile

Post by JRL » Mon Feb 08, 2016 8:56 pm

The problem with the script is probably because you strip off the path then when you try to copy the file the file is not found. Try doing the copyfile using the strNewFile variable.

Why the (code)...(/code) doesn't work I don't know. I logged in and edited your code and it still didn't work. Must be some setting in your user options. Perhaps you have "Disable BBCode" checked?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts