Jump to content

Url page+1 with shortcut

Recommended Posts

const browser = Application('Safari')

const current_tab_url = browser.documents[0].url()
const base_url = current_tab_url.substring(0, current_tab_url.lastIndexOf('=') + 1)
const current_number = current_tab_url.substring(current_tab_url.lastIndexOf('=') + 1, current_tab_url.length)

const next_number = Number(current_number) + 1

if (isNaN(next_number)) {
  browser.documents[0].url = current_tab_url + '&page=2'
} else {
  browser.documents[0].url = base_url + next_number


Edited by vitor

Share this post

Link to post

I have one more situation. When I search by keyword "test" first, it looks like this:  https://www.shutterstock.com/search?searchterm=test&sort=popular&image_type=all&search_source=base_landing_page&language=en, without &page=1

but without this, the workflow doesn't work. 


How to add a suffix so that it works from the first page, or maybe it has another way?

Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...