Created
June 18, 2021 22:18
-
-
Save pjohnmeyer/3727db0f1afc7c5ce6d55ddc5756c6f9 to your computer and use it in GitHub Desktop.
Bookmarklet: Copy Asana task link as Markdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function()%7Bconst%20taskId%20%3D%20document.querySelectorAll('div.SingleTaskPaneSpreadsheet')%5B0%5D.getAttribute('data-task-id')%3Bconst%20taskTitle%20%3D%20document.querySelectorAll('textarea%5Baria-label%3D%22Task%20Name%22%5D')%5B0%5D.value%3Bconst%20mdLink%20%3D%20%60%5B%24%7BtaskTitle%7D%5D(https%3A%2F%2Fapp.asana.com%2F0%2F0%2F%24%7BtaskId%7D%2Ff)%60%3Bnavigator.clipboard.writeText(mdLink)%7D)() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const taskId = document.querySelectorAll('div.SingleTaskPaneSpreadsheet')[0].getAttribute('data-task-id'); | |
const taskTitle = document.querySelectorAll('textarea[aria-label="Task Name"]')[0].value; | |
const mdLink = `[${taskTitle}](https://app.asana.com/0/0/${taskId}/f)`; | |
navigator.clipboard.writeText(mdLink); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment