Safari – Changing the Format of the Front Web Page's URL

Howdy,

I am attempting to make a macro to convert a URL such as:

https://www.tcgplayer.com/product/251874/metazoo-nightfall-first-edition-grim-reaper?xid=pi6202b4b2-100f-4dd0-8626-6e4a21119d44&page=1&Language=English

To:

https://store.tcgplayer.com/admin/product/manage/251874

In order to do this I was going to endeavor to apply a regex to %SafariURL%, but I am not doing a good job of even figuring out how to do that with things such as 'filter' that are linked by the docs. Any ideas on solving this problem? Thanks!

Tokens are read-only, so you can't alter their contents in any way. What you can do is set them to variables, which can then be manipulated however you like. In the case of applying a regex to a URL, you'll want to use a Search and Replace action rather than a filter:

GG is right, and I infer from your post that you basically want to delete all characters starting with the fifth slash. Is that exactly what you want to do?

This did the trick, thanks for the pointer!

1 Like

Hey Justin,

You don't have to open an new page unless you want to.

image

Set Safari URL Action

-Chris

Nice catch, thanks! I had added a CMD-W and it was definitely inelegant.

1 Like