From 4439667dc2f107fcb441caa8c578ccd73570160c Mon Sep 17 00:00:00 2001 From: "Saw, Hansly Kendrich" Date: Tue, 20 Sep 2022 17:19:51 +0800 Subject: [PATCH] added working workflow --- Open Anyway.workflow/Contents/Info.plist | 31 ++++ .../Contents/QuickLook/Thumbnail.png | Bin 0 -> 551 bytes Open Anyway.workflow/Contents/document.wflow | 159 ++++++++++++++++++ 3 files changed, 190 insertions(+) create mode 100644 Open Anyway.workflow/Contents/Info.plist create mode 100644 Open Anyway.workflow/Contents/QuickLook/Thumbnail.png create mode 100644 Open Anyway.workflow/Contents/document.wflow diff --git a/Open Anyway.workflow/Contents/Info.plist b/Open Anyway.workflow/Contents/Info.plist new file mode 100644 index 0000000..1a6fcfb --- /dev/null +++ b/Open Anyway.workflow/Contents/Info.plist @@ -0,0 +1,31 @@ + + + + + NSServices + + + NSBackgroundColorName + background + NSIconName + NSTouchBarCircleAdd + NSMenuItem + + default + Open Anyway + + NSMessage + runWorkflowAsService + NSRequiredContext + + NSApplicationIdentifier + com.apple.finder + + NSSendFileTypes + + public.item + + + + + diff --git a/Open Anyway.workflow/Contents/QuickLook/Thumbnail.png b/Open Anyway.workflow/Contents/QuickLook/Thumbnail.png new file mode 100644 index 0000000000000000000000000000000000000000..c205a4aa7d7ee6f0c1c38f577e01e9d14febb900 GIT binary patch literal 551 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTCmUKs7M+SzC{oH>NS%G|oWRD45dJguM!v-tY$DUh!@P+6=(yLU`z6LcLCBs@Y8vBJ&@uo z@Q5r1(g|SvA=~LZ0|TR`r;B4q#=W;Q4Y>{(h&aqYdR6+x8ut$hmkwUusnxW(*<9$L zmDY;~i&V{WKYbQ{X#XO_^u6lJ1eU`FJ(D6C*cUL)YYdlOdH$mjvz{Px8vhOM6YBgD zr7R`~RF>Q^cDs;M6*JdG|Di+J0ojAPOC%pm*0)+vc4Bu@7f-?2Kg<#TogJp{Iq^f2 zx#p8A`x#>Cg`oh1Zi?dn%BwKIGINvjIf5zW;<28?u^Xc>h zecy$$y5k#jd-fzsxK+iS*t!4zw3pX%fuW~b;u=wsl30>zm0Xkxq!^40jEr;*EOm_x wLJZ8T41vg8+rYrez`*zP8zmGCx%nxXX_dG&*h~wV2h_me>FVdQ&MBb@0MLrY`Tzg` literal 0 HcmV?d00001 diff --git a/Open Anyway.workflow/Contents/document.wflow b/Open Anyway.workflow/Contents/document.wflow new file mode 100644 index 0000000..876ff02 --- /dev/null +++ b/Open Anyway.workflow/Contents/document.wflow @@ -0,0 +1,159 @@ + + + + + AMApplicationBuild + 515 + AMApplicationVersion + 2.10 + AMDocumentVersion + 2 + actions + + + action + + AMAccepts + + Container + List + Optional + + Types + + com.apple.applescript.object + + + AMActionVersion + 1.0.2 + AMApplication + + Automator + + AMParameterProperties + + source + + + AMProvides + + Container + List + Types + + com.apple.applescript.object + + + ActionBundlePath + /System/Library/Automator/Run AppleScript.action + ActionName + Run AppleScript + ActionParameters + + source + # The following function, convertPathToPOSIXString(thePath), is from Apple's documentation page. on convertPathToPOSIXString(thePath) tell application "System Events" try set thePath to path of disk item (thePath as string) on error set thePath to path of thePath end try end tell return POSIX path of thePath end convertPathToPOSIXString on run {input, parameters} set file_open_raw to input as string set file_open to convertPathToPOSIXString(file_open_raw) try display alert "Open file?" message ("You are about to open " & file_open & ". \n\nBeware that if you downloaded the app from a website that you do not usually browse on or is not known, it may most likely damage your operating system and/or your files.") buttons {"× Cancel", "→ Open"} default button 2 cancel button 1 do shell script ("sudo xattr -r -c '" & file_open & "' && sudo touch '" & file_open & "'") with administrator privileges try do shell script ("open '" & file_open & "'") on error try display alert "Couldn't open file." message ("Try to open the file from the Finder") as critical buttons {"× Cancel"} default button 1 cancel button 1 on error # Prevent AppleScript from detecting an error by returning a false value. return false end try end try on error return false end try (* Your script goes here *) return input end run + + BundleIdentifier + com.apple.Automator.RunScript + CFBundleVersion + 1.0.2 + CanShowSelectedItemsWhenRun + + CanShowWhenRun + + Category + + AMCategoryUtilities + + Class Name + RunScriptAction + InputUUID + D6064ADF-D60A-4546-A3A6-0290FAE67046 + Keywords + + Run + + OutputUUID + E877AFFC-3A4C-4D19-81F8-52D7C70EB10B + UUID + 09D77354-F3A0-415E-A755-578A1A1CFE79 + UnlocalizedApplications + + Automator + + arguments + + 0 + + default value + on run {input, parameters} + + (* Your script goes here *) + + return input +end run + name + source + required + 0 + type + 0 + uuid + 0 + + + isViewVisible + 1 + location + 309.000000:368.000000 + nibPath + /System/Library/Automator/Run AppleScript.action/Contents/Resources/Base.lproj/main.nib + + isViewVisible + 1 + + + connectors + + workflowMetaData + + applicationBundleID + com.apple.finder + applicationBundleIDsByPath + + /System/Library/CoreServices/Finder.app + com.apple.finder + + applicationPath + /System/Library/CoreServices/Finder.app + applicationPaths + + /System/Library/CoreServices/Finder.app + + inputTypeIdentifier + com.apple.Automator.fileSystemObject + outputTypeIdentifier + com.apple.Automator.nothing + presentationMode + 15 + processesInput + 0 + serviceApplicationBundleID + com.apple.finder + serviceApplicationPath + /System/Library/CoreServices/Finder.app + serviceInputTypeIdentifier + com.apple.Automator.fileSystemObject + serviceOutputTypeIdentifier + com.apple.Automator.nothing + serviceProcessesInput + 0 + systemImageName + NSTouchBarCircleAdd + useAutomaticInputType + 0 + workflowTypeIdentifier + com.apple.Automator.servicesMenu + + +