AppleScripting Search with start_search

Greetings,

This does work:


-------------------------------------------------------------------
set theQuery to "a brief history of time"
tell application "DEVONagent"
	activate
	set theURL to "x-devonagent://runPlugin?identifier=com.devon-technologies.internet.plugin&query="
	set theURL to theURL & (do JavaScript "encodeURIComponent('" & theQuery & "')" in browser 1)
	get URL theURL
end tell
-------------------------------------------------------------------

I’m disappointed that I have to use a browser window to encode the search string using JavaScript.

(Yes I know I can do it with vanilla AppleScript, but it would be more convenient if the JavaScript engine was more globally available.)

I’m surprised the search window cannot handle spaces between search terms in the URL automatically. It just stalls.

I am astounded that a search cannot be initiated with a normal AppleScript query:

-----------------------------------------------------------
set mySearch to "a brief history of time"
tell application "DEVONagent"
	activate
	search mySearch using set "Internet (Fast Scan)"
	-- No way to start the search...
end tell
-------------------------------------------------------------------

To have to resort to System Events to click the search button and activate the search is surely due to an oversight on your part. One little property would solve the problem:


search mySearch using set "Internet (Fast Scan)" with start_search

The first script is an overly complex way of accomplishing this job.

Please fix this.

It would also be nice if the search field of any given window type could be get/set with AppleScript (again without resorting to System Events.

Thank you.

  • NOTE: At the moment I am working with some dyslexic folks to improve their usage of your product.


Best Regards,
Christopher Stone

Umm… ```
tell application id “DNag”
set search_Term to “a brief history of time”
search search_Term using plugin “com.devon-technologies.google_web.plugin”
end tell

Thank you BLUEFROG for your reply, but that script alone doesn’t help a great deal.

The DEVONagent dictionary does not suggest a plugin or search-set designation is required for a search to be activated.

There is virtually no information on AppleScripting the app in the User Manual.

The number of example scripts are fairly few.

Explanation is sparse.

Note that the bundle-id is canonically correct these days, while the creator-code is deprecated in OSX.

tell application id "com.devon-technologies.agent"
	set searchSetList to search sets
	set plugInList to plugins
end tell

Note also that as someone new to scripting DA (but not to AppleScript) it would be useful to know where to find the search sets and plugins (as shown above).

Every scriptable app has its quirks.


Best Regards,
Christopher Stone

Jim didn’t say it was required; he suggested a way to use the plugin option. DA dictionary entry for “Search” in Script Editor (top) and Script Debugger (bottom).

Now I’m confused. Have you used the program? – e.g.,

Are you trying to teach Applescript or assisting people with DEVONagent?

Thank you korm,

I’ve been using Script Debugger since 1993 and have already examined same.

Note that the bracketed parameters are optional. Once again nothing indicates that “search ” should not initiate the search.

Ah, thank you for demonstrating the options under window. That is genuinely helpful.

I own a copy of DA but have not used it a great deal.

I am currently trying to help some dyslexic folks utilize DA in a way that works for them.


Best Regards,
Christopher Stone

Hello Jim,

Not very helpful.

I did ask for help. Providing one snippet of code without explanation of any kind is rarely helpful, unless it very obviously illuminates an issue. Then there’s the condescending (or easily taken as such) comment “Umm…”.

I am in the process of helping some dyslexic folks use DA in a way that works for them.

I am a multi-product customer of DEVONtechnologies trying learn something for my own edification and to assist other DT customers — I certainly don’t need the attitude.


Regards,
Christopher Stone

With all respect, your original post was presented as a series of statements and complaints.

The terminology used and the tone suggested someone who had a higher perspective of DEVONagent and automation in general. But the assertions about what can and can’t be done were either incorrect or not rigorously tested. Hence my response with a very simple example fulfilling the basic request.

My second response was a legitimate question as it was very unclear what level of knowledge you had of DEVONagent (and it’s automation abilities).

My apologies if you feel offended.

Tech support requires conversation. (I’ve been doing it for 20 years.)

I will apologize as well. My initial tone reflected more than a half-day of research on your forums and on the Internet trying to do something that should have been a complete no-brainer.

I do not find much in the way of example scripts for DEVONAgent. The scripts included with the app are helpful but not comprehensive. Perhaps I’ve missed something?


Best Regards,
Chris

DEVONagent is very scriptable – but also not very often scripted. There are some examples in Help > Support Assistant. There are Automator actions. And, very rarely, there is a script posted in the DEVONagent/Scripting section of this forum. (Script discussions here run about 20:1 DEVONthink Scripting:DEVONagent Scripting). Why? That’s just the way it works out. Since you’ve been using Script Debugger for ~22 years you’ll be really familiar with Explorer and other features that are terrific for sussing out how to interact with an application object. That’s basically the kind of thing all of us do when we learn to code. Hope you come up with some really cool DEVONagent AppleScript solutions that you’ll share with us in the future 8)

@ ccstone: I’m curious about your approach to helping folk with dyslexia to perform DEVONagent searches. I assume you are dealing with issues of recognition of and/or entering terms in search criteria. How does scripting help?

Although I’m not dyslexic, I’m occasionally fumble-fingered and make typos in a query that DEVONagent nevertheless try to search for, with null or unexpected results. :slight_smile:

More often, my own search problems boil down to choice of terms and appropriate operators and syntax that will have a high probability of finding useful results from pages that exist out in the Web.