How can I set the x and y coordinates of a string variable?

Ayano

Member
Through autoinput I can get the coordinates of an element

example:

120,400 and they are part of a string variable

How can I specifically take the first value 120 and set it as the x of a click and the second value 400 as the y of the same click?
 

mapriex

Active member
1) split the string in an array with "text manipulation".
2) either save the relevant array ids to a variable or access direct the entries on ui click - with x,y coordinates and choose the entries.
 

Ayano

Member
1) split the string in an array with "text manipulation".
2) either save the relevant array ids to a variable or access direct the entries on ui click - with x,y coordinates and choose the entries.
Have I to set delimiter? Because it seems doesn't work and be sure because I'm a newbie.
In the string there is: 400,900 but when I test this spitted array it says 0,8 why?
 

Attachments

  • Screenshot_20240225_085043_com.arlosoft.macrodroid.jpg
    Screenshot_20240225_085043_com.arlosoft.macrodroid.jpg
    320.9 KB · Views: 9

Dimlos

Well-known member
You might be able to tell by looking at the settings of this macro.
 

Attachments

  • Macro.jpg
    Macro.jpg
    423.8 KB · Views: 10
  • split_string_variable.macro
    3.2 KB · Views: 3

mapriex

Active member
almost right, you don't need to choose string lenght. you want the variable itself. looking with the 3 dots for your variable.

as delimeter: you want to seperate it on a certain key, like a blanket or a comma.
 

Attachments

  • Screenshot_20240225-112643.png
    Screenshot_20240225-112643.png
    136.8 KB · Views: 6

Dm114

Well-known member
Through autoinput I can get the coordinates of an element

example:

120,400 and they are part of a string variable

How can I specifically take the first value 120 and set it as the x of a click and the second value 400 as the y of the same click?
You also could use Extract... (Text manipulation) with following Regex rules:
- For X: ^\d+,
- For Y: ,\d+$
 
Top