SCREENCAPTURE and number file progressive

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
mpsinfo
Junior Coder
Posts: 20
Joined: Mon Apr 19, 2021 1:31 pm

SCREENCAPTURE and number file progressive

Post by mpsinfo » Wed Jan 31, 2024 7:41 pm

Hi everyone, I'm saving screenshots with progressive file names, but my code writes in this way

Code: Select all

Let>cnc=1
Let>cnr=1
ScreenCapture>20,20,3200,1350,Z:\LAVORI\MAPPE\HALTA\ZONA_%cnr%_%cnc%.bmp
the file write is ZONA_1_1.bmp

I would need
files named like this.

il file write is ZONA_001_001.bmp next ZONA_002_001.bmp ecc. ecc.



Can you tell me how I can do it?

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1389
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: SCREENCAPTURE and number file progressive

Post by Dorian (MJT support) » Wed Jan 31, 2024 11:43 pm

Format will help you here.

You could do this :

Code: Select all

Let>cnc=1
Format>%.3d,cnc,cncformatted

Let>cnr=1
Format>%.3d,cnr,cnrformatted

ScreenCapture>20,20,3200,1350,Z:\LAVORI\MAPPE\HALTA\ZONA_%cnrformatted%_%cncformatted%.bmp
Or even just this :

Code: Select all

Let>cnc=1
Format>%.3d,cnc,cnc

Let>cnr=1
Format>%.3d,cnr,cnr

ScreenCapture>20,20,3200,1350,Z:\LAVORI\MAPPE\HALTA\ZONA_%cnr%_%cnc%.bmp
Yes, we have a Custom Scripting Service. Message me or go here

mpsinfo
Junior Coder
Posts: 20
Joined: Mon Apr 19, 2021 1:31 pm

Re: SCREENCAPTURE and number file progressive

Post by mpsinfo » Thu Feb 01, 2024 9:46 am

Thanks for the advice, but is that command available from some version of Macro Scheduler upwards?

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1389
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: SCREENCAPTURE and number file progressive

Post by Dorian (MJT support) » Thu Feb 01, 2024 11:00 am

It was added to v14.2 in 2014 and should be available in Lite/Std/Pro

Version 14.2 03/11/2014
- Added: Format function to format numbers and strings
Yes, we have a Custom Scripting Service. Message me or go here

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

Re: SCREENCAPTURE and number file progressive

Post by JRL » Thu Feb 01, 2024 6:23 pm

Perhaps a little VB?

Code: Select all

VBSTART
VBEND
Let>cnc=1
Let>cnr=2
VBEval>right("000" & "%cnr%",3) & "_" & right("000" & "%cnc%",3),vNamePart
ScreenCapture>20,20,3200,1350,Z:\LAVORI\MAPPE\HALTA\ZONA_%vNamePart%.bmp

mpsinfo
Junior Coder
Posts: 20
Joined: Mon Apr 19, 2021 1:31 pm

Re: SCREENCAPTURE and number file progressive

Post by mpsinfo » Sat Feb 03, 2024 9:37 am

Even if sooner or later I will have to update my v.11 version, this latest solution is truly extraordinary. I didn't know you could use VB in Macro Scheduler, I'm really still a newbie.

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