Jump to content

How to get text from multiple browser tabs and perform actions on all of them


Recommended Posts

Hey!

 

I am trying to automate a process that I do regularly.

 

The context of the actual process is that I send direct messages to people who like my instagram posts. The way I do this is open up all of the users who've liked my post into a new tab in chrome. Therefore what I want to do is hit a hotkey that will gather all of the usernames from the url's in the browser tabs and then go to the new DM link and paste in their username so that all I have to do is select them and type out my message to them.

 

My understanding of what I need to do is:

 

1. get the URL's from the browser tabs (with the automation task) [url format is: https://www.instagram.com/[username]/ ]

2. split the URL's into separate variables (with split Arg) [not sure how to do this]

3. run the get column from text automation task on each variable to extract the username from the URL [know how to do this 1 time but not for a list of multiple variables]

4. open up a new tab for sending a DM to each person (link: https://www.instagram.com/direct/new/) [don't know how to do this for the number of variables I'll have]

5. copy to clipboard and paste the split variable for each person. [don't know how to paste these in in a repeatable process]

 

How do I do this and make it a repeatable workflow so that it will generate all of the tabs with the usernames already pasted in?

 

My guess is that I'll need to get the list of URL's, split them, then run a loop that extracts the username, opens a tab for them, pastes in the username to the field and then goes to the next one until there's no more variables. But I don't know how to actually implement that. I'll also want to close all the tabs before opening the new ones so there's not loads of them open.

Link to comment

For the first steps ([AT] for “Automation Task”):


[AT] Get safari Tab List → [AT] Get Matching Arguments (for instagram URLs) → Join Args (with newline) → [AT] Get Column from Text (for the username). On the last one you could also use a Replace Utility to strip the part of the URL you don’t want.


Then it gets trickier, because Instagram (for some reason) doesn’t provide a way to go directly to a Direct Message page for a specific person (I don‘t use Instagram, this is based on a quick search). And at lest in Safari, opening the same page a bunch of times in a row will just make it go back to the same one (which is sensible behaviour). You’d have to automate the browser to do the opening of each tab and pasting of content. Instagram is incredibly restrictive to anyone who doesn’t have an account, so I cannot be more precise here.


To close the matching tabs, there is also an Automation Task for that.

Link to comment

Thanks for the reply Vitor.

 

Perhaps the best way of doing this as a workflow is to split up the two processes into 2 automations.

 

1 automation to get the usernames and put them into a text file as a list of usernames separated by a new line.

 

And then a second automation to highlight the text on that row go to the new DM page URL and paste the username so that I can select the person and send them the message.

 

Quote

→ Join Args (with newline) → [AT] Get Column from Text (for the username)

 

Will the join args function remove the need for the loop because the list of tabs will be in 1 variable how do I extract each instance of the "usernames" perhaps replace will be better as it will remove every instance of the url and /, is that correct?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...