Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting


Thread Tools Rate Thread Display Modes
Old 11-08-2012, 01:09 PM
kplatts kplatts is offline
Registered User
Join Date: Oct 2012
Posts: 6
Python pass x,y coordiantes to Screen.Get?

I've tried several ways to grab data from the screen at certaqin x,y coordinates using a variable, but the script keeps failing saying there are not enough arguments (the command requires 4 arguments and there is only 1 listed).

xyxy = (14,17,14,20)
status = crt.Screen.Get("%s" %(xyxy))


xf = 14
yf = 17
xl = 14
yl = 20
xyxy = ("%i,%i,%i,%i" %(xf,yf,xl,yl))
status = crt.Screen.Get("%s" %(xyxy))


status = crt.Screen.Get("%i,%i,%i,%i" %(xy,xf,xl,yl))
When I do a crt.Dialg.MessageBox("%s" %(xyxy)) it prints out as 14,17,14,20 as I would expect it to.

Can I use this command this way?
Reply With Quote
Old 11-08-2012, 01:55 PM
rtb rtb is offline
VanDyke Technical Support
Join Date: Aug 2008
Posts: 4,306
Hi kplatts,

Thanks for the question. The Get method requires 4 unique integer parameters. The error you are seeing is a result of providing a single string parameter.
Here are a couple of valid ways to use the Get method:
MsgBox = crt.Dialog.MessageBox
nRow1 = 14
nCol1 = 17
nRow2 = 14
nCol2 = 20
MsgBox(crt.Screen.Get(nRow1, nCol1, nRow2, nCol2))
MsgBox = crt.Dialog.MessageBox
MsgBox(crt.Screen.Get(14, 17, 14, 20))
The MessageBox method requires a single string parameter to function. This is why you can use string formatting.

VanDyke Software
Technical Support

Last edited by rtb; 11-08-2012 at 02:05 PM.
Reply With Quote
Old 11-08-2012, 04:46 PM
kplatts kplatts is offline
Registered User
Join Date: Oct 2012
Posts: 6
Thanks! I've got it all working now.

Reply With Quote


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 05:50 AM.