Skip to content

Instantly share code, notes, and snippets.

@leonid-shevtsov
Created October 11, 2024 20:05
Show Gist options
  • Save leonid-shevtsov/ec1f1d78d6168b2eeb4084794bb74240 to your computer and use it in GitHub Desktop.
Save leonid-shevtsov/ec1f1d78d6168b2eeb4084794bb74240 to your computer and use it in GitHub Desktop.
// Javascript for Mac Automation (JXA)
function run(input, parameters) {
let currentTab = Application("Safari").windows[0].currentTab;
let issueText = String(currentTab.name()).replace(/^\[(.+)\]/, '$1:').replace(/- JIRA$/,'' )
let app = Application.currentApplication();
app.includeStandardAdditions = true;
app.displayNotification(issueText, { withTitle: "📋 Copied to clipboard" });
app.setTheClipboardTo(issueText);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment