mhmd320666 Posted May 14, 2019 Share Posted May 14, 2019 Hello i maked script yesterday but somthing is wrong let me explain what the problem First of all that is my script gg.clearResults() gg.setRanges(gg.REGION_C_ALLOC) gg.searchNumber("0,0;0,0;0,0;0,0;0,0;-0,0;0,5;-360,0;360,0;740,0;0,5;-740,0;0,0;0,0;0,0;0,0;0,0;1,0;1,0;0,0;0,0;0,0;0,0;0,0;1,0;1,0;1,0;1,0;0,0;0,0;0,0;1,0:133", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) gg.searchNumber("0.5", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1) t = gg.getResults(10) gg.editAll("0", gg.TYPE_FLOAT) t[1].value = "0" t[2].value = "0.5" t[3].value = "0" t[4].value = "0.5" t[1].freeze = true t[2].freeze = true t[3].freeze = true t[4].freeze = true print("addListItems: ", gg.addListItems(t)) gg.toast(" + ") Now the script muss to search at fist value the to 0.5 and freeze 2 from 4 result But gg when he search for first value it says 0 founded while searching to100% When searching finish is then it shows 72 results For this problem when i run script he search to first value then he dont find result but actually there is 72 results normally Then he search to 0.5 and i get 300 result Because he dont found somthing on fiest value Link to comment Share on other sites More sharing options...
Administrators Enyby Posted May 14, 2019 Administrators Share Posted May 14, 2019 Use refineNumber if you need refine. Link to comment Share on other sites More sharing options...
mhmd320666 Posted May 14, 2019 Author Share Posted May 14, 2019 2 hours ago, Enyby said: Use refineNumber if you need refine. How can i do it can youplease fix script the script is in my text Link to comment Share on other sites More sharing options...
Administrators Enyby Posted May 14, 2019 Administrators Share Posted May 14, 2019 Use refineNumber instead of second searchNumber. Link to comment Share on other sites More sharing options...
mhmd320666 Posted May 14, 2019 Author Share Posted May 14, 2019 34 minutes ago, Enyby said: Use refineNumber instead of second searchNumber. What is false now after refline i muss to get 4 result then it muss freeze the first and the third result but script wrong Link to comment Share on other sites More sharing options...
mhmd320666 Posted May 14, 2019 Author Share Posted May 14, 2019 I got this failed Link to comment Share on other sites More sharing options...
Administrators Enyby Posted May 14, 2019 Administrators Share Posted May 14, 2019 1. Scripts work always in English locale. So 0.5 must use dot, not a comma. 2. You must check count of found results. Not blind load all and work with it. It can be zero results. So you try index not exists results and all go to hell. Link to comment Share on other sites More sharing options...
Question
mhmd320666
Hello i maked script yesterday but somthing is wrong let me explain what the problem
First of all that is my script
gg.clearResults()
gg.setRanges(gg.REGION_C_ALLOC)
gg.searchNumber("0,0;0,0;0,0;0,0;0,0;-0,0;0,5;-360,0;360,0;740,0;0,5;-740,0;0,0;0,0;0,0;0,0;0,0;1,0;1,0;0,0;0,0;0,0;0,0;0,0;1,0;1,0;1,0;1,0;0,0;0,0;0,0;1,0:133", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1)
gg.searchNumber("0.5", gg.TYPE_FLOAT, false, gg.SIGN_EQUAL, 0, -1)
t = gg.getResults(10)
gg.editAll("0", gg.TYPE_FLOAT)
t[1].value = "0"
t[2].value = "0.5"
t[3].value = "0"
t[4].value = "0.5"
t[1].freeze = true
t[2].freeze = true
t[3].freeze = true
t[4].freeze = true
print("addListItems: ", gg.addListItems(t))
gg.toast(" + ")
Now the script muss to search at fist value the to 0.5 and freeze 2 from 4 result
But gg when he search for first value it says 0 founded while searching to100%
When searching finish is then it shows 72 results
For this problem when i run script he search to first value then he dont find result but actually there is 72 results normally
Then he search to 0.5 and i get 300 result
Because he dont found somthing on fiest value
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.