Page 1 of 1

list pasted into Find box changes to Jon OR Amy OR Dan...

Posted: 06 May 2015 22:52
by kunkel321
Just an idea here...
(and there might already be a smarter way to get the same effect).

I work at a high school and have tons of stuff archived regarding students. Lately I find myself with a list of kids--for example:
Jonny Doe
Amy Smith
Dan Johnson

That I have to do same research on.

My current workflow is to copy-n-paste each name into the <Ctrl+F> Find Box, then drag the needed items to a PaperFolder (or a DropStack Icon, now :ugeek: ). One search per student.

If possible, it would be cool for that Find Box to detect the <Line Feeds> or <carriage returns> or whatever they are, and change them to "OR," such that the above three-line list would get converted to:
Jonny Doe OR Amy Smith OR Dan Johnson when pasted in...

Thots?

Re: list pasted into Find box changes to Jon OR Amy OR Dan..

Posted: 06 May 2015 23:25
by Marco
It's already doable with scripting, as you probably may have imagined.
You set up the search and save it as search template. Then you write a little script that takes in input the list of scholars > replace <crlf>'s with OR's > setkey such string in the proper key of the search template ini > and finally fires the search.

Re: list pasted into Find box changes to Jon OR Amy OR Dan..

Posted: 07 May 2015 16:48
by kunkel321
Marco wrote:It's already doable with scripting, as you probably may have imagined....
Thanks for the reply. Yea, I figured it could probably be scripted. Maybe I will post it as a request on the Script sub-forum. As it turns out, I also figured out how to do the replacements via Clipboard Help+Spell, which has text manipulation presets...

Re: list pasted into Find box changes to Jon OR Amy OR Dan..

Posted: 07 May 2015 17:26
by highend
Maybe I will post it as a request on the Script sub-forum

Code: Select all

copytext replace(formatlist("<clipboard>", "e", "<crlf>"), "<crlf>", " OR ");

Re: list pasted into Find box changes to Jon OR Amy OR Dan..

Posted: 08 May 2015 22:59
by kunkel321
Cool thanks Highend!

I'm curious, what does the "e" do? Is it a temporary variable or something? I've noticed that variables in XY script are often (usually?) single letters...

Might work more on this script if I get a chance... I'll post any questions on the Script Help forum though :biggrin:

Re: list pasted into Find box changes to Jon OR Amy OR Dan..

Posted: 08 May 2015 23:05
by highend
I'm curious, what does the "e" do?
It belongs to the formatlist command and removes empty items. Otherwise you'd get a trailing " OR" at the end of the line...