CHROME Parsing Final Step Output! But stuck

ACTUAL GOAL: open these 30 x View Detail links in 30 new tabs in Chrome

so I managed this

var x = document.getElementsByClassName("view-detail-link");

for(var i=0;i<x.length;i++)
{
alert(x[i].href);
}

The results is just a list of URLs like this

I'm trying to output the 30 URLs into clipboard into Text file but this kept popping up 30 times in Chrome when execute this macro


(had to enable View > Developer > Allow Javascript From Apple Events in Chrome)

I might be making this more complicated than needs to be.

But all I need is to open these same 'View Detail' link in 30 new tabs.
Cause each tab will contain different info

For example

https://trade.aliexpress.com/order_detail.htm?orderId=98435497171144
https://trade.aliexpress.com/order_detail.htm?orderId=98374925301144
https://trade.aliexpress.com/order_detail.htm?orderId=98436331761144
etc.

Hey @ciprobay,

And why do you suppose that is?

Some rascal put an alert in your code...   :wink:

Try this.

(Its an action and will import directly into the macro currently being edited in the Keyboard Maestro Editor.)

Execute a JavaScript in Safari.kmactions (876 B)

I'm not sure why you want to put this on the clipboard.

I'd pop it into a variable and then use a For Each action with a Lines in a Variable condition.

(Although you can certainly use the clipboard instead of a variable.)

You can use that to serially create new tabs in Chrome with the New Google Chrome Tab action.

-Chris

1 Like