I’m trying to build an action that would allow me to use each line of draft to generate a new search, with each search result opening in a new tab in my browser. (Use case: Type a list of groceries, run the action, and have the browser open a series of tabs, each of which contains the Amazon/Whole Foods search results for an item listed on a line of the draft.)
I can do that very inelegantly by using a series of URL steps, each of which adds a different line to the search query. For example:
https://www.amazon.com/s?k=[[line|1]]&i=wholefoods&ref=nb_sb_noss_1
https://www.amazon.com/s?k=[[line|2]]&i=wholefoods&ref=nb_sb_noss_1
https://www.amazon.com/s?k=[[line|3]]&i=wholefoods&ref=nb_sb_noss_1
But that approach isn’t tied to the number of items on my list. if I had just two items and ran an action with three URL steps (using the URLs above), I’d get one tab for each of the two items, and then a third tab with a blank search result. On the other hand, if I had four items, I’d only get tabs for the first three – which means that, to make my action useful, I’d need it to contain a large number of URL steps, and most of the time I’d then end up with a ton of blank search pages.
I suspect that there’s a very simple way to produce a more elegant solution, but I’m very inexperienced with any sort of coding, and have been unable to figure out how to modify any of the other examples I’ve seen in the forums to accomplish this. For example, the discussion of looping an action for each line here seems like it would be helpful, but I’ve failed in my attempts to modify the functions that it calls so that it would generate an appropriate URL for each line.
Any help would be much appreciated!