Skip to content

Instantly share code, notes, and snippets.

@mu373
Last active December 19, 2020 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mu373/efae5bddb417035d87b4ef866269e190 to your computer and use it in GitHub Desktop.
Save mu373/efae5bddb417035d87b4ef866269e190 to your computer and use it in GitHub Desktop.
Simplify Amazon URL

Simplify Amazon URL: Automator action for Safari

  • This is an Automator service/quick action that generates a clean and simple URL for Amazon product pages on Mac Safari
  • It removes all unnecessary parameters from URL, such as search queries and product names
  • Simplified link will be copied to the clipboard

Example

before

https://www.amazon.co.jp/Amazonベーシック-USB-AケーブルLightningコネクタ付き、プレミアムコレクション-10cm-、2点入りパック/dp/B07FGKRX7M/ref=sr_1_1_sspa?__mk_ja_JP=カタカナ&dchild=1&keywords=lightning&qid=1608376160&sr=8-1-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUExVUo0Wk9VTFVEMFQ1JmVuY3J5cHRlZElkPUEwMTcyMDYwR1ZGTlZTMDhZOEFNJmVuY3J5cHRlZEFkSWQ9QTJSMEtUNkszMDkwUlomd2lkZ2V0TmFtZT1zcF9hdGYmYWN0aW9uPWNsaWNrUmVkaXJlY3QmZG9Ob3RMb2dDbGljaz10cnVl

after

https://www.amazon.co.jp/dp/B07FGKRX7M

Setup

  • Make new "Quick Action" in Automator
    • Add "Run Apple Script" as an action
    • Copy and paste the script
    • Save
  • Allow JavaScipt execution by Automator on Safari
    • On Safari: Menubar > Develop > Allow JavaScript from Apple Events
    • If the Develop menu is not enabled yet, follow the procedures here.

Usage

  • Open an Amazon product page which you want to simplify its URL
  • Menubar > Safari > Services > Simplify Amazon link
  • Simplified link will be copied to the clipboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment