Skip to content

Instantly share code, notes, and snippets.

@pjohnmeyer
Created June 18, 2021 22:18
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 pjohnmeyer/3727db0f1afc7c5ce6d55ddc5756c6f9 to your computer and use it in GitHub Desktop.
Save pjohnmeyer/3727db0f1afc7c5ce6d55ddc5756c6f9 to your computer and use it in GitHub Desktop.
Bookmarklet: Copy Asana task link as Markdown
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)()
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