Variables don't parse when using them in a filename for the ScreenCapture command.
Example
This works:
ScreenCapture>1,1,200,200,C:\SCTest.BMP
This fails:
Let>FName=C:\SCTest.BMP
ScreenCapture>1,1,200,200,%FName%
The returned error is "1", meaning "Invalid file type specified. Valid file types are .BMP or .JPG".
As presented in another post by someone else, I could force a filename, then rename it to whatever I wanted (the rename command will accept a %variable%). But this is prone to certain problems.
Bug? ScreenCapture with variables in filename.
Moderators: JRL, Dorian (MJT support)
You are indeed correct! FName will work, yet %FName% will not.
However, I almost always use:
Let>VAREXPLICIT=1
... which causes FName to not work.
I will have to keep (or set it back to 0) during any use of this command.
Still, in my opinion this should be fixed. Variables with %'s should be allowed to be used.
Do you remember what other command was like this?
However, I almost always use:
Let>VAREXPLICIT=1
... which causes FName to not work.

I will have to keep (or set it back to 0) during any use of this command.
Still, in my opinion this should be fixed. Variables with %'s should be allowed to be used.
Do you remember what other command was like this?
Its late, he might be sleeping.
See mtettmar's explanation for varexplicit here:
http://www.mjtnet.com/forum/viewtopic.p ... arexplicit
This fails for me whether varexplicit is 1 or 0.
Just tried the following and it worked:
- Varexplicit set to 0
- Removed the .BMP from the variable and stuck it on the end of the "ScreenCapture" parameters.
Let>FName=C:\SCTest
ScreenCapture>1,1,200,200,%FName%.bmp
Later,
Dick
See mtettmar's explanation for varexplicit here:
http://www.mjtnet.com/forum/viewtopic.p ... arexplicit
This fails for me whether varexplicit is 1 or 0.
Edit---Let>FName=C:\SCTest.BMP
ScreenCapture>1,1,200,200,%FName%
Just tried the following and it worked:
- Varexplicit set to 0
- Removed the .BMP from the variable and stuck it on the end of the "ScreenCapture" parameters.
Let>FName=C:\SCTest
ScreenCapture>1,1,200,200,%FName%.bmp
Later,
Dick
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Not sure what's up with ScreenCapture. Will check it out.
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?