diff --git a/utils/ug2leadsheets.workflow/Contents/Info.plist b/utils/ug2leadsheets.workflow/Contents/Info.plist new file mode 100644 index 0000000..42bff03 --- /dev/null +++ b/utils/ug2leadsheets.workflow/Contents/Info.plist @@ -0,0 +1,30 @@ + + + + + NSServices + + + NSBackgroundColorName + background + NSIconName + NSActionTemplate + NSMenuItem + + default + ug2leadsheets + + NSMessage + runWorkflowAsService + NSReturnTypes + + public.utf8-plain-text + + NSSendTypes + + public.utf8-plain-text + + + + + diff --git a/utils/ug2leadsheets.workflow/Contents/QuickLook/Preview.png b/utils/ug2leadsheets.workflow/Contents/QuickLook/Preview.png new file mode 100644 index 0000000..53cdd37 Binary files /dev/null and b/utils/ug2leadsheets.workflow/Contents/QuickLook/Preview.png differ diff --git a/utils/ug2leadsheets.workflow/Contents/QuickLook/Thumbnail.png b/utils/ug2leadsheets.workflow/Contents/QuickLook/Thumbnail.png new file mode 100644 index 0000000..61a713b Binary files /dev/null and b/utils/ug2leadsheets.workflow/Contents/QuickLook/Thumbnail.png differ diff --git a/utils/ug2leadsheets.workflow/Contents/document.wflow b/utils/ug2leadsheets.workflow/Contents/document.wflow new file mode 100644 index 0000000..40348b2 --- /dev/null +++ b/utils/ug2leadsheets.workflow/Contents/document.wflow @@ -0,0 +1,152 @@ + + + + + AMApplicationBuild + 509 + AMApplicationVersion + 2.10 + AMDocumentVersion + 2 + actions + + + action + + AMAccepts + + Container + List + Optional + + Types + + com.apple.applescript.object + + + AMActionVersion + 1.0 + AMApplication + + Automator + + AMParameterProperties + + source + + + AMProvides + + Container + List + Types + + com.apple.applescript.object + + + ActionBundlePath + /System/Library/Automator/Run JavaScript.action + ActionName + Run JavaScript + ActionParameters + + source + // To make this work as a keyboard shortcut see: +// https://apple.stackexchange.com/a/276839 +function run(input, parameters) { var out = []; var a = input[0].split("\n"); var chords = null; + var chordsWidth = 0; for (var i = 0; i < a.length; i++) { var l = a[i].replace(/\s+$/, ''); if (l.length == 0) { chords = null; out.push(""); continue; } if (chords == null) { chords = []; var re = /\w+/g; while ((match = re.exec(l)) != null) { chords.push(match); } + chordsWidth = l.length; } else { + l = l.padEnd(chordsWidth, ' '); for (var j = chords.length - 1; j >= 0; j--) { var c = chords[j]; l = [l.slice(0, c.index), "^{" + c[0] + "}", l.slice(c.index)].join(''); } out.push(l); chords = null; } } return out.join("\n"); } + + BundleIdentifier + com.apple.Automator.RunJavaScript + CFBundleVersion + 1.0 + CanShowSelectedItemsWhenRun + + CanShowWhenRun + + Category + + AMCategoryUtilities + + Class Name + RunJavaScriptAction + InputUUID + 555334C7-BCA3-4076-93AF-83AFBC032149 + Keywords + + Run + JavaScript + + OutputUUID + 49501A03-B942-40B3-B7FF-F8FCAB781925 + UUID + DF3317F5-9683-4C3A-A867-C4ADAD810C4D + UnlocalizedApplications + + Automator + + arguments + + 0 + + default value + function run(input, parameters) { + + // Your script goes here + + return input; +} + name + source + required + 0 + type + 0 + uuid + 0 + + + isViewVisible + 1 + location + 533.250000:548.000000 + nibPath + /System/Library/Automator/Run JavaScript.action/Contents/Resources/Base.lproj/main.nib + + isViewVisible + 1 + + + connectors + + workflowMetaData + + applicationBundleIDsByPath + + applicationPaths + + inputTypeIdentifier + com.apple.Automator.text + outputTypeIdentifier + com.apple.Automator.text + presentationMode + 11 + processesInput + 0 + serviceInputTypeIdentifier + com.apple.Automator.text + serviceOutputTypeIdentifier + com.apple.Automator.text + serviceProcessesInput + 0 + systemImageName + NSActionTemplate + useAutomaticInputType + 0 + workflowTypeIdentifier + com.apple.Automator.servicesMenu + + +