Send variable stuck

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
romnem
Newbie
Posts: 1
Joined: Wed Mar 12, 2025 11:26 am

Send variable stuck

Post by romnem » Wed Mar 12, 2025 11:34 am

Hi, I'm using a script that needs to print (save as PDF) tons of pages. However, when the "Save as" window appears and I send the file name (which is an incremental number under the variable num) instead of let's say 145, it gets stuck in 14, it press enter and therefore an alert message of overwritting an existing file appears.

I've tried with several wait options, send and sendText, num=num+1, Add>num,1... and I've checked debugging that the num counter is working , but I dont know why it gets stuck at writting the file name.

Code: Select all

ResizeWindow>Guardar impresión como,1800,1080
Wait>0.5
Send>num
Wait>0.5
Press Enter
...more code...
Add>num,1
Do you guys know how I could fix this? I have to save the order of 80.000 pages and having to stop every 30/40 is a nightmare.

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

Re: Send variable stuck

Post by Dorian (MJT support) » Wed Mar 12, 2025 2:36 pm

This is most likely timing. Maybe slow down the sendkey speed (adjust timings as required)...

Code: Select all

//Wait 100 milliseconds between keystrokes
let>sk_delay=100
Send>num
Or put num into the clipboard and paste it instead of sending (good for long text strings)

Code: Select all

Putclipboard>num
wait>0.1
press ctrl
wait>0.1
send>v
wait>0.1
release ctrl
.... instead of repeating the 0.1 second Waits above, you could instead use step_delay to wait 100 milliseconds between steps ...

Code: Select all

let>step_delay=100
Putclipboard>num
press ctrl
send>v
release ctrl

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