Jump to content

Archived

This topic is now archived and is closed to further replies.

Re_Load

How can I distinguish between the presence and absence of search results in script?

Recommended Posts

I want script make like this

gg.searchNumber("[number]")

 

If there is no search result : os.exit()

 

 

if present some results in the result list : search other number to refine list

so I can prevent app from crash.

Share this post


Link to post
Share on other sites

getResultsCount function from the API can be used to get count of found results.

Example of usage: 

-- some search
print('Found ' .. gg.getResultsCount() .. ' result(s)')

Share this post


Link to post
Share on other sites

×
×
  • Create New...