Below is a script that uses GREP to find straight apostrophies and then change them to smart (curly) ones. The script invokes the Find/Change dialog so that the user can see what she or he is doing.
However, if the user last used the Find/Change dialog in the TEXT mode, that is the mode that appears. I want the script to go to the GREP mode. I see that there is code for app.loadFindChangeQuery(queryName, searchMode), but I have no idea what the "queryName" is and how to use it in this script.