MrBe1ieVe / copy-url-for-alfred

You can copy browser's URL and title with various formats like markdown, anchor tag and your own.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Copy Safari URL for Alfred

You can copy safari's URL and title with various formats like markdown, anchor tag and your own.

screenshot

My setting as follow:

[{
        "format": "${url}",
        "title": "URL"
    },
    {
        "format": "${title}\n${url}",
        "title": "Expand"
    },
    {
        "format": "[${title}](${url})",
        "title": "Markdown"
    }
]

Installation

Powerpack is required.

  1. Download copyurl-catalina.alfredworkflow on macOS Catalina or Big Sur.
  2. Open file by double-clicking or dragging into Alfred.
  3. Go to Alfred Setting -> Features -> Default Results -> Fallbacks -> "Setup fallback result" and remove all the fallback.
  4. Open Alfred and type url, if not appear, go back to Step 3 to check the fallback setting.
  5. Select URL format.

You can change everything at Alfred Preferences > Workflows menu.

Add your own template

  1. Open ~/Library/Application Support/Alfred/Workflow Data/com.fallroot.copyurl/config.json file.
  2. Edit contents with valid JSON format.

config.json format

config.json file should be array of object is consist of format and type fields. format field should be string of combination ${url}, ${title} or JavaScript function string like below.

[
    {
        "format": "${url}",
        "title": "URL"
    },
    {
        "format": "${title}",
        "title": "Title"
    },
    {
        "format": "<a href=\"${url}\">${title}</a>",
        "title": "Anchor"
    },
    {
        "format": "[${title}](${url})",
        "title": "Markdown"
    },
    {
        "format": "function({title,url}){return title.toUpperString() + '\\n' + url}",
        "title": "Custom"
    }
]

Supported Browsers

2021/7/24:

  • Chrome 92.0.4515.107
  • Safari

The Edge 92.0.902.55 and Firefox 90.0.1 didn't work

License

MIT

Icon

Icons made by DinosoftLabs from www.flaticon.com

About

You can copy browser's URL and title with various formats like markdown, anchor tag and your own.

License:MIT License


Languages

Language:JavaScript 100.0%