DCools Posted July 16, 2022 Share Posted July 16, 2022 Hello, "Get Window Bounds" returns for example: {"x":280,"y":105,"width":2000,"height":1200} How can I read the width or the height and select a conditional? For example: "if width is smaller then 2000" then ... else ...? I can't find help about how to process the return of "Get Window Bounds" in the returned format and the conditional if else... Best regards, Diederick. Link to comment
vitor Posted July 16, 2022 Share Posted July 16, 2022 Welcome @DCools, That output is valid JSON you can process in a number of ways. Because it’ll be consistent, you can use a Replace Utility set to replace regex .*"width":(\d+),.* with $1, which will give you the width. But we can do better. Automations Tasks 2022.7 was just released with a dropdown so you can return individual details like the width. Link to comment
DCools Posted July 16, 2022 Author Share Posted July 16, 2022 (edited) Yes, Thank you it works thanks to 2022.7 the easy width selection. I will play with the Replace Utility and regex to understand how it works that way. Regex I understand and use now and then with other script languages. Regards, Diederick. Edited July 16, 2022 by DCools Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now