I encountered an issue while using the XMove or XMovetext X commands to store initial coordinates. Specifically, when storing the initial position (e.g., via `store|${ocrX},${ocrY}|coordinates_first`), the variable `${coordinates_first}` appears to dynamically update to the latest coordinates instead of retaining the original values. Consequently, I am unable to reference the initial position after moving to a new location.
Could you advise on how to correctly retrieve the initial coordinates using the Xmove or similar X command?
**Environment**: Windows 10, Microsoft Edge, UI.Vision IDE 9.5.3.
Refer to the dump : the X command locate text “Putin” postion
Please refer to script as below:
```javascript
{
“Name”: “5_Testing-OCR”,
“CreationDate”: “2025-10-20”,
“Commands”: [
{
“Command”: “store”,
“Target”: “!OCRLanguage=eng”,
“Value”: “”,
“Description”: “!OCRLanguage=chs eng”
},
{
“Command”: “store”,
“Target”: “99”,
“Value”: “!ocrEngine”,
“Description”: “XModule 99; Javascript 98; ”
},
{
“Command”: “store”,
“Target”: “true”,
“Value”: “!OCRScale”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “true”,
“Value”: “!OCRTableExtraction”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “60”,
“Value”: “!TIMEOUT_PAGELOAD”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “60”,
“Value”: “!TIMEOUT_WAIT”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “true”,
“Value”: “!errorignore”,
“Description”: “”
},
{
“Command”: “XDesktopAutomation”,
“Target”: “false”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “open”,
“Target”: “http://en.ce.cn/main/latest/202510/t20251017_2522918.shtml”,
“Value”: “”,
“Description”: “”
},
{
“Command”: “XMouseWheel”,
“Target”: “3”,
“Value”: “”,
“Description”: "负上 ,正下 移动 "
},
{
“Command”: “echo”,
“Target”: “${!ocrX} , ${!ocrY}”,
“Value”: “blue”,
“Description”: “”
},
{
“Command”: “visionLimitSearchArea”,
“Target”: “viewport”,
“Value”: “”,
“Description”: “full/viewport/area=184,297,1818,888”
},
{
“Command”: “OCRSearch”,
“Target”: “Putin”,
“Value”: “a”,
“Description”: “Putin”
},
{
“Command”: “echo”,
“Target”: “${a}”,
“Value”: “red”,
“Description”: “”
},
{
“Command”: “XMoveText”,
“Target”: “Putin@pos=1”,
“Value”: “”,
“Description”: “Putin@pos=1”
},
{
“Command”: “echo”,
“Target”: “${!ocrX} , ${!ocrY}”,
“Value”: “green”,
“Description”: “”
},
{
“Command”: “store”,
“Target”: “${!ocrX},${!ocrY}”,
“Value”: “coordinates_first”,
“Description”: “”
},
{
“Command”: “echo”,
“Target”: “${coordinates_first}”,
“Value”: “green”,
“Description”: “”
},
{
“Command”: “XMoveText”,
“Target”: “Putin@pos=2”,
“Value”: “”,
“Description”: “Putin@pos=1”
},
{
“Command”: “echo”,
“Target”: “${!ocrX} , ${!ocrY}”,
“Value”: “blue”,
“Description”: “”
},
{
“Command”: “XMoveTextRelative”,
“Target”: “Putin@pos=2#R0,-20”,
“Value”: “”,
“Description”: “Putin#R0,-20”
},
{
“Command”: “echo”,
“Target”: “${!ocrX} , ${!ocrY}”,
“Value”: “blue”,
“Description”: “”
},
{
“Command”: “XClick”,
“Target”: “${coordinates_first}”,
“Value”: “”,
“Description”: “Putin@pos=1”
},
{
“Command”: “echo”,
“Target”: “${!ocrX} , ${!ocrY}”,
“Value”: “green”,
“Description”: “”
},
{
“Command”: “OCRExtractbyTextRelative”,
“Target”: “Putin@pos=2#R-5,-1H10W50”,
“Value”: “extractresult”,
“Description”: “”
},
{
“Command”: “echo”,
“Target”: “${extractresult}”,
“Value”: “blue”,
“Description”: “”
}
]
}
```
Please refer to script log:
```javascript
-
status]
Playing macro 5_Testing-OCR -
[info]
Executing: | store | !OCRLanguage=eng | | -
[info]
Executing: | store | 99 | !ocrEngine | -
[info]
Executing: | store | true | !OCRScale | -
[info]
Executing: | store | true | !OCRTableExtraction | -
[info]
Executing: | store | 60 | !TIMEOUT_PAGELOAD | -
[info]
Executing: | store | 60 | !TIMEOUT_WAIT | -
[info]
Executing: | store | true | !errorignore | -
[info]
Executing: | XDesktopAutomation | false | | -
[info]
Executing: | open | http://en.ce.cn/main/latest/202510/t20251017_2522918.shtml | | -
[info]
Executing: | XMouseWheel | 3 | | -
[info]
Executing: | echo | ${!ocrX} , ${!ocrY} | blue | -
[echo]
0 , 0 -
[info]
Executing: | visionLimitSearchArea | viewport | | -
[info]
Executing: | OCRSearch | Putin | a | -
[info]
OCR (chs) started (151.3 KB) -
[info]
OCR result received (2.2s from XModule OCR) -
[info]
Executing: | echo | ${a} | red | -
[echo]
4 -
[info]
Executing: | XMoveText | Putin@pos=1 | | -
[info]
OCR (chs) started (124.7 KB) -
[info]
OCR result received (1.7s from XModule OCR) -
[info]
Executing: | echo | ${!ocrX} , ${!ocrY} | green | -
[echo]
245.5 , 85 -
[info]
Executing: | store | ${!ocrX},${!ocrY} | coordinates_first | -
[info]
Executing: | echo | ${coordinates_first} | green | -
[echo]
245.5,85 -
[info]
Executing: | XMoveText | Putin@pos=2 | | -
[info]
OCR (chs) started (128.5 KB) -
[info]
OCR result received (1.5s from XModule OCR) -
[info]
Executing: | echo | ${!ocrX} , ${!ocrY} | blue | -
[echo]
93.5 , 216.5 -
[info]
Executing: | XMoveTextRelative | Putin@pos=2#R0,-20 | | -
[info]
OCR (chs) started (129.1 KB) -
[info]
OCR result received (1.5s from XModule OCR) -
[info]
Executing: | echo | ${!ocrX} , ${!ocrY} | blue | -
[echo]
74 , 350 -
[info]
Executing: | XClick | ${coordinates_first} | | -
[info]
Executing: | echo | ${!ocrX} , ${!ocrY} | green | -
[echo]
74 , 350 -
[info]
Executing: | OCRExtractbyTextRelative | Putin@pos=2#R-5,-1H10W50 | extractresult | -
[info]
OCR (chs) started (128.0 KB) -
[info]
OCR result received (1.6s from XModule OCR) -
[info]
OCR (chs) started (17.2 KB) -
[info]
OCR result received (0.9s from XModule OCR) -
[info]
Executing: | echo | ${extractresult} | blue | -
[echo]
the Russia-Ukraine conflict, following a phl ersation the two leaders. -
[info]
Macro completed (Runtime 39.42s) -
[status]
Playing macro 5_Testing-OCR -
[info]
Executing: | store | !OCRLanguage=eng | | -
[info]
Executing: | store | 99 | !ocrEngine | -
[info]
Executing: | store | true | !OCRScale | -
[info]
Executing: | store | true | !OCRTableExtraction | -
[info]
Executing: | store | 60 | !TIMEOUT_PAGELOAD | -
[info]
Executing: | store | 60 | !TIMEOUT_WAIT | -
[info]
Executing: | store | true | !errorignore | -
[info]
Executing: | XDesktopAutomation | false | | -
[info]
Executing: | open | http://en.ce.cn/main/latest/202510/t20251017_2522918.shtml | | -
[error][ignored]
Line 9: Error #102: Lost contact to website -
[info]
Executing: | XMouseWheel | 3 | | -
[info]
Executing: | echo | ${!ocrX} , ${!ocrY} | blue | -
[echo]
0 , 0 -
[info]
Executing: | visionLimitSearchArea | viewport | | -
[info]
Executing: | OCRSearch | Putin | a | -
[info]
OCR (chs) started (146.8 KB) -
[info]
OCR result received (4.1s from XModule OCR) -
[info]
Executing: | echo | ${a} | red | -
[echo]
4 -
[info]
Executing: | XMoveText | Putin@pos=1 | | -
[info]
OCR (chs) started (146.8 KB) -
[info]
OCR result received (2.7s from XModule OCR) -
[info]
Executing: | echo | ${!ocrX} , ${!ocrY} | green | -
[echo]
688 , 237.5 -
[info]
Executing: | store | ${!ocrX},${!ocrY} | coordinates_first | -
[info]
Executing: | echo | ${coordinates_first} | green | -
[echo]
688,237.5 -
[info]
Executing: | XMoveText | Putin@pos=2 | | -
[info]
OCR (chs) started (151.2 KB) -
[info]
OCR result received (2.0s from XModule OCR) -
[info]
Executing: | echo | ${!ocrX} , ${!ocrY} | blue | -
[echo]
952.5 , 396 -
[info]
Executing: | XMoveTextRelative | Putin@pos=2#R0,-20 | | -
[info]
OCR (chs) started (150.9 KB) -
[info]
OCR result received (2.0s from XModule OCR) -
[info]
Executing: | echo | ${!ocrX} , ${!ocrY} | blue | -
[echo]
937 , 531 -
[info]
Executing: | XClick | ${coordinates_first} | | -
[info]
Executing: | echo | ${!ocrX} , ${!ocrY} | green | -
[echo]
937 , 531 -
[info]
Executing: | OCRExtractbyTextRelative | Putin@pos=2#R-5,-1H10W50 | extractresult | -
[info]
OCR (chs) started (151.3 KB) -
[info]
OCR result received (1.9s from XModule OCR) -
[info]
OCR (chs) started (7.1 KB) -
[info]
OCR result received (1.0s from XModule OCR) -
[info]
Executing: | echo | ${extractresult} | blue | -
[echo]
e one,• said Trump on Truth Sccial. -
[info]
Macro completed (Runtime 52.18s)
```
