New version appears to have changed IfFileexists
Moderators: JRL, Dorian (MJT support)
New version appears to have changed IfFileexists
In previous versions the command Iffileexists would allow a wildcard and the version 9 dosn't appear to. I tested the following script on Version 9 and it didn't work, but it did on 8. I have used this command in a lot of macros. I know I could get around it but it would be alot of changes. The script I tested is
IfFileExists>C:\LoanArchiveFiles\*.tif
MDL>Yes
Else
MDL>No
Endif
Version 8 returns yes Version 9 no
IfFileExists>C:\LoanArchiveFiles\*.tif
MDL>Yes
Else
MDL>No
Endif
Version 8 returns yes Version 9 no
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Hi,
Odd. We haven't changed anything in regard to IfFileExists and intended and documented behaviour has always been that it does not support wildcards. The function that we call internally is not documented to support wildcards either.
Odd. We haven't changed anything in regard to IfFileExists and intended and documented behaviour has always been that it does not support wildcards. The function that we call internally is not documented to support wildcards either.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
I will need to check but I am sure that I have used the same syntax over the past few years, many versions ...
IfFileExist>Drive:\path\*day.txt is used to make sure I am backing up to a drive named Monday, Tuesday, Wed......... etc.
If this fails, I skip the backup to that drive.
I don't recall trying that during version 9 Beta testing.
Sorry, I cannot confirm that for a few days.
IfFileExist>Drive:\path\*day.txt is used to make sure I am backing up to a drive named Monday, Tuesday, Wed......... etc.
If this fails, I skip the backup to that drive.
I don't recall trying that during version 9 Beta testing.
Sorry, I cannot confirm that for a few days.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Hi guys,
Like Me_again I've never used the wildcard "feature" in IfFileExists. I just tried the sample script in versions 7.3, 8.0 and 9.0.043. The wildcard worked in versions 7 and 8 but it did not work in 9. Tomorrow (if this isn't resolved by then) I can try earlier versions of 9 and maybe find in which version 9 build this change occurred.
Like Me_again I've never used the wildcard "feature" in IfFileExists. I just tried the sample script in versions 7.3, 8.0 and 9.0.043. The wildcard worked in versions 7 and 8 but it did not work in 9. Tomorrow (if this isn't resolved by then) I can try earlier versions of 9 and maybe find in which version 9 build this change occurred.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
I have just compared our source code from v8 and v9 branches and there is no difference in the code used. The documentation for the internal function we call says it requires a full filename.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
On further investigation it appears that the function we call internally for IfFileExists used to work with wildcards but was never meant to officially - hence the reason the documentation states not. Between v8 and v9 we upgraded to the new version of the Delphi compiler. So v9 is compiled with a newer version of Delphi and it turns out that the FileExists function is implemented differently to fix an issue and now no longer supports wildcards. While it was never meant to support wildcards, and was never documented as such, the fact is the old version did, and in turn previous versions of Macro Scheduler's IfFileExists function did also. I can therefore see that this could be an annoyance and break existing scripts. Therefore we will issue an update shortly with an alternative implementation of IfFileExists (and the FILE_EXISTS AND FILE_NOTEXISTS OnEvent functions).
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Please note, this has now been addressed in build 047:
http://www.mjtnet.com/forum/viewtopic.php?t=3534
http://www.mjtnet.com/forum/viewtopic.php?t=3534
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Hi Marcus,
Thanks for addressing this quickly with a Maintenance Release so backwards compatibility with older scripts was not compromised.
I realize you have printed documentation and updates may take a while... but now that the wildcard ability of IfFileExists (and the OnEvent versions) has been made *official*, please make a note to update the Help File to this effect. Examples showing the proper use of the wildcard would be great.
Thanks again and keep up the great work
Thanks for addressing this quickly with a Maintenance Release so backwards compatibility with older scripts was not compromised.
I realize you have printed documentation and updates may take a while... but now that the wildcard ability of IfFileExists (and the OnEvent versions) has been made *official*, please make a note to update the Help File to this effect. Examples showing the proper use of the wildcard would be great.
Thanks again and keep up the great work
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -

- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact: