├── .gitignore ├── AbracodeFramework ├── Abracode.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── tkukielk.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ ├── xcshareddata │ │ └── xcschemes │ │ │ ├── Abracode Framework.xcscheme │ │ │ └── All.xcscheme │ └── xcuserdata │ │ └── tkukielk.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist ├── AbracodeFramework.exp ├── AbracodeFrameworkVersion.c ├── Abracode_Prefix.pch ├── Base.lproj │ ├── OMCOutputPanel.xib │ ├── OMCOutputWindow.xib │ ├── input_clear.xib │ ├── input_combo.xib │ ├── input_password.xib │ ├── input_popup.xib │ └── progress.xib ├── CMUtils │ ├── CMUtils.h │ ├── CMUtilsAEFile.cp │ ├── CMUtilsAEText.cp │ ├── CMUtilsBundle.cp │ ├── CMUtilsClipboard.cp │ ├── CMUtilsFinder.cp │ ├── CMUtilsMenu.cp │ ├── CMUtilsObjectList.cp │ ├── CMUtilsSendAE.cp │ ├── SubmenuTree.cp │ └── SubmenuTree.h ├── CocoaControls │ ├── OMC Controls Properties.txt │ ├── OMCBox.h │ ├── OMCBox.m │ ├── OMCButton.h │ ├── OMCButton.m │ ├── OMCButtonCell.h │ ├── OMCButtonCell.m │ ├── OMCComboBox.h │ ├── OMCComboBox.m │ ├── OMCGridView.h │ ├── OMCGridView.m │ ├── OMCIKImageView.h │ ├── OMCIKImageView.m │ ├── OMCImageView.h │ ├── OMCImageView.m │ ├── OMCMenuItem.h │ ├── OMCMenuItem.m │ ├── OMCPDFView.h │ ├── OMCPDFView.m │ ├── OMCPopUpButton.h │ ├── OMCPopUpButton.m │ ├── OMCProgressIndicator.h │ ├── OMCProgressIndicator.m │ ├── OMCQCView.h │ ├── OMCQCView.mm │ ├── OMCQTMovieView.h │ ├── OMCQTMovieView.m │ ├── OMCSearchField.h │ ├── OMCSearchField.m │ ├── OMCSecureTextField.h │ ├── OMCSecureTextField.m │ ├── OMCSlider.h │ ├── OMCSlider.m │ ├── OMCTableView.h │ ├── OMCTableView.m │ ├── OMCTextField.h │ ├── OMCTextField.m │ ├── OMCTextView.h │ ├── OMCTextView.m │ ├── OMCView.h │ ├── OMCView.m │ ├── OMCWebKitView.h │ ├── OMCWebKitView.m │ ├── OMCWebView.h │ └── OMCWebView.m ├── DefaultExternBundle.cpp ├── DefaultExternBundle.h ├── Info.plist ├── MoreAppleEvents │ ├── MoreAppleEvents.cp │ └── MoreAppleEvents.h ├── NibDialogControl.cp ├── NibDialogControl.h ├── OMC.cpp ├── OMC.h ├── OMCCocoaDialog.h ├── OMCCocoaDialog.mm ├── OMCCocoaNib.h ├── OMCCocoaNib.m ├── OMCCommandExecutor.h ├── OMCCommandExecutor.m ├── OMCCommandMenu.h ├── OMCCommandMenu.mm ├── OMCConstants.h ├── OMCCustomWindow.h ├── OMCCustomWindow.mm ├── OMCDeferredProgress.h ├── OMCDeferredProgress.mm ├── OMCDialog.cpp ├── OMCDialog.h ├── OMCDialogController.h ├── OMCDialogController.mm ├── OMCDropletController.h ├── OMCDropletController.mm ├── OMCEnvironmentExportScript.cpp ├── OMCEnvironmentExportScript.h ├── OMCFilePanels.h ├── OMCFilePanels.mm ├── OMCHelpers.h ├── OMCHelpers.mm ├── OMCInputDialog.h ├── OMCInputDialog.mm ├── OMCInputDialogController.h ├── OMCInputDialogController.m ├── OMCMainMenuController.h ├── OMCMainMenuController.m ├── OMCObserver.cpp ├── OMCObserver.h ├── OMCOutputWindowController.h ├── OMCOutputWindowController.mm ├── OMCPanel.h ├── OMCPanel.m ├── OMCProgressWindowController.h ├── OMCProgressWindowController.m ├── OMCScriptsManager.cpp ├── OMCScriptsManager.h ├── OMCService.h ├── OMCService.m ├── OMCSingleCommand.h ├── OMCSingleCommand.m ├── OMCStrings.h ├── OMCStrings.mm ├── OMCTableViewController.h ├── OMCTableViewController.mm ├── OMCTerminalExecutor.cp ├── OMCTerminalExecutor.h ├── OMCWindow.h ├── OMCWindow.m ├── OMCiTermExecutor.cp ├── OMCiTermExecutor.h ├── OmcExecutor.cp ├── OmcExecutor.h ├── OmcTaskManager.cpp ├── OmcTaskManager.h ├── OmcTaskNotification.h ├── OnMyCommand.cp ├── OnMyCommand.h ├── OutputWindowHandler.cp ├── OutputWindowHandler.h ├── Resources │ ├── OMCWebKitSupport.js │ ├── app.icns │ └── stop.icns ├── SelectionIterator.h ├── de.lproj │ ├── Private.strings │ ├── input_clear.xib │ ├── input_combo.xib │ ├── input_password.xib │ └── input_popup.xib ├── en.lproj │ └── Private.strings ├── fr.lproj │ └── Private.strings ├── ja.lproj │ └── Private.strings ├── omc_popen.c └── omc_popen.h ├── Common ├── ACFArr.h ├── ACFDict.h ├── ACFPropertyList.h ├── ACFPropertyList.m ├── ACFType.cp ├── ACFType.h ├── ACFURL.h ├── ACFURL.m ├── ACMPlugin.cp ├── ACMPlugin.h ├── ANotifier.h ├── AObserver.h ├── AObserverBase.h ├── ARefCounted.cp ├── ARefCounted.h ├── AUniquePtr.h ├── CFObj.h ├── DebugSettings.h ├── MessagePortListener.h ├── MessagePortSend.cpp ├── MessagePortSend.h ├── OmcProjectCommon.xcconfig ├── OmcProjectDebug.xcconfig ├── OmcProjectRelease.xcconfig ├── OmcTool_Info.plist ├── OmcVersion.xcconfig ├── PlistPreferences.cp ├── PlistPreferences.h ├── StAEDesc.h ├── StSwitchToFront.h └── StSwitchToFront.mm ├── LICENSE ├── OMC.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ ├── IDEWorkspaceChecks.plist │ └── xcschemes │ └── OMC Distribution.xcscheme ├── OMCApplet ├── Base.lproj │ └── MainMenu.nib │ │ ├── designable.nib │ │ └── keyedobjects.nib ├── Command-release.plist ├── Command.plist ├── Info.plist ├── OMCApplet.entitlements ├── OMCApplet.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── OMCApplet.xcscheme ├── OMCApplet_Prefix.pch ├── app.icns ├── de.lproj │ └── MainMenu.nib │ │ ├── designable.nib │ │ └── keyedobjects.nib ├── en.lproj │ └── InfoPlist.strings └── main.m ├── OMCService ├── Base.lproj │ └── MainMenu.xib ├── Command.plist ├── OMCService-Info.plist ├── OMCService.entitlements ├── OMCService.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── OMCService.xcscheme ├── OMCService_Prefix.pch └── main.m ├── OMCTestApp ├── Base.lproj │ ├── Example1.nib │ │ ├── designable.nib │ │ └── keyedobjects.nib │ ├── ImageKit.nib │ │ ├── designable.nib │ │ └── keyedobjects.nib │ ├── LegacyWebKit.nib │ │ ├── designable.nib │ │ └── keyedobjects.nib │ ├── MainMenu.nib │ │ ├── designable.nib │ │ └── keyedobjects.nib │ ├── QCDialog.nib │ │ ├── designable.nib │ │ └── keyedobjects.nib │ ├── QuickTime.nib │ │ ├── designable.nib │ │ └── keyedobjects.nib │ └── WebKitView.nib │ │ ├── designable.nib │ │ └── keyedobjects.nib ├── Command-minimal.plist ├── Command.plist ├── Example.plist ├── ForOutputObserver.plist ├── Info.plist ├── Introduction.qtz ├── Ls Browser.omc │ └── Contents │ │ └── Resources │ │ ├── Command.plist │ │ └── English.lproj │ │ └── Browser.nib │ │ ├── designable.nib │ │ └── keyedobjects.nib ├── OMCTestApp.entitlements ├── OMCTestApp.h ├── OMCTestApp.m ├── OMCTestApp.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── OMCTestApp.xcscheme ├── OMCTestApp_Prefix.pch ├── QCDialog.qtz ├── TextContext.plist ├── en.lproj │ └── InfoPlist.strings ├── gzip.plist ├── main.m ├── sunflower.jpg ├── test.AppleScript.applescript ├── test.exe.script.file.sh ├── test.javascript.js ├── test.webkit.example.client.js ├── test.webkit.example.html ├── test.webkitview.clicked.sh ├── test.webkitview.execute.sh ├── test.webkitview.init.sh └── test.webkitview.set.url.sh ├── OnMyCommandCM ├── ACMPluginProxy.cp ├── Icon.rsrc ├── Info-OnMyCommandCM.plist ├── OnMyCommandCM.cp ├── OnMyCommandCM.exp ├── OnMyCommandCM.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── app.icns ├── README.md ├── alert--help.md ├── alert ├── alert.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── alert.xcscheme └── main.c ├── b64--help.md ├── b64 ├── ABase64.c ├── ABase64.h ├── b64.1 ├── b64.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── b64.xcscheme └── main.c ├── build.sh ├── filt--help.md ├── filt ├── filt.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── filt.xcscheme └── main.c ├── loco--help.md ├── loco ├── loco.1 ├── loco.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── loco.xcscheme ├── loco_Info.plist └── main.c ├── notify--help.md ├── notify ├── notify.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ └── notify.xcscheme ├── notify │ ├── NotifyDelegate.h │ ├── NotifyDelegate.m │ ├── main.m │ └── notify.1 └── notify_Info.plist ├── omc_controls_user_defined_runtime_attributes.md ├── omc_dialog_control--help.md ├── omc_dialog_control ├── generate_app_group_identifier.sh ├── main.c └── omc_dialog_control.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ └── xcschemes │ └── omc_dialog_control.xcscheme ├── omc_next_command--help.md ├── omc_next_command ├── main.c └── omc_next_command.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ └── xcschemes │ └── omc_next_command.xcscheme ├── pasteboard--help.md ├── pasteboard ├── pasteboard.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── pasteboard.xcscheme └── pasteboard │ ├── main.m │ └── pasteboard.1 ├── plister--help.md └── plister ├── 0.plist ├── main.cpp ├── plister.1 └── plister.xcodeproj ├── project.pbxproj ├── project.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist └── xcshareddata └── xcschemes └── plister.xcscheme /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.xcuserstate 3 | xcuserdata 4 | *.xcuserstate 5 | build/ 6 | Common/OmcDistribution.xcconfig 7 | -------------------------------------------------------------------------------- /AbracodeFramework/Abracode.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AbracodeFramework/Abracode.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AbracodeFramework/Abracode.xcodeproj/project.xcworkspace/xcuserdata/tkukielk.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/AbracodeFramework/Abracode.xcodeproj/project.xcworkspace/xcuserdata/tkukielk.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /AbracodeFramework/Abracode.xcodeproj/xcshareddata/xcschemes/All.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 52 | 53 | 59 | 60 | 66 | 67 | 68 | 69 | 71 | 72 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /AbracodeFramework/Abracode.xcodeproj/xcuserdata/tkukielk.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Abracode Framework.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | All.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 1 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 8DC2EF4F0486A6940098B216 21 | 22 | primary 23 | 24 | 25 | E2575FF40D20EE1000D755FF 26 | 27 | primary 28 | 29 | 30 | E257605F0D20EECA00D755FF 31 | 32 | primary 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /AbracodeFramework/AbracodeFramework.exp: -------------------------------------------------------------------------------- 1 | # Public APIs visible in Abracode.framework 2 | 3 | _OMCGetCurrentVersion 4 | _OMCRunCommand 5 | _OMCRunCommandAE 6 | _OMCCreateExecutor 7 | _OMCReleaseExecutor 8 | _OMCRetainExecutor 9 | _OMCFindCommand 10 | _OMCExamineContext 11 | _OMCExamineContextAE 12 | _OMCGetCommandInfo 13 | _OMCExecuteCommandAE 14 | _OMCExecuteCommand 15 | _OMCCreateObserver 16 | _OMCReleaseObserver 17 | _OMCRetainObserver 18 | _OMCAddObserver 19 | _OMCUnregisterObserver 20 | 21 | .objc_class_name_OMCCommandExecutor 22 | 23 | _OBJC_CLASS_$_OMCPopUpButton 24 | _OBJC_CLASS_$_OMCSearchField 25 | _OBJC_CLASS_$_OMCCommandMenu 26 | _OBJC_CLASS_$_OMCButton 27 | _OBJC_CLASS_$_OMCMenuItem 28 | _OBJC_CLASS_$_OMCButtonCell 29 | _OBJC_CLASS_$_OMCImageView 30 | _OBJC_CLASS_$_OMCTextView 31 | _OBJC_CLASS_$_OMCDropletController 32 | _OBJC_CLASS_$_OMCService 33 | _OBJC_CLASS_$_OMCSingleCommand 34 | _OBJC_CLASS_$_OMCMainMenuController 35 | _OBJC_CLASS_$_OMCSlider 36 | _OBJC_CLASS_$_OMCWebView 37 | _OBJC_CLASS_$_OMCIKImageView 38 | _OBJC_CLASS_$_OMCProgressIndicator 39 | _OBJC_CLASS_$_OMCQCView 40 | _OBJC_CLASS_$_OMCTextField 41 | _OBJC_CLASS_$_OMCSecureTextField 42 | _OBJC_CLASS_$_OMCView 43 | _OBJC_CLASS_$_OMCPDFView 44 | _OBJC_CLASS_$_OMCBox 45 | _OBJC_CLASS_$_OMCTableView 46 | _OBJC_CLASS_$_OMCComboBox 47 | 48 | 49 | __ZN13OnMyCommandCMC1EPKv 50 | 51 | _CreateDefaultExternBundleRef 52 | _GetEscapingModeString 53 | _GetEscapingMode 54 | _ReplaceWhitespaceEscapesWithCharacters 55 | _ReplaceWhitespaceCharactersWithEscapes 56 | 57 | 58 | _CreateEnviron 59 | _ReleaseEnviron 60 | _omc_popen 61 | _omc_pclose 62 | _omc_pclose_write 63 | 64 | __ZN7CMUtils29CreateUniTextDescFromCFStringEPK10__CFStringR6AEDesc 65 | __ZN7CMUtils24CreateCFStringFromAEDescERK6AEDescl 66 | __ZN7CMUtils28CreateUTF8StringFromCFStringEPK10__CFString 67 | __ZN7CMUtils22PutCFStringToClipboardEPK10__CFString 68 | 69 | __ZN7ACFTypeIPK11__CFBooleanE7sTypeIDE 70 | __ZN7ACFTypeIPK10__CFNumberE7sTypeIDE 71 | __ZN7ACFTypeIPK9__CFArrayE7sTypeIDE 72 | __ZN7ACFTypeIPK10__CFStringE7sTypeIDE 73 | __ZN7ACFTypeIPK14__CFDictionaryE7sTypeIDE 74 | 75 | __ZN11ARefCounted15sCFSetCallbacksE 76 | 77 | __ZN15StSwitchToFrontC1Eb 78 | __ZN15StSwitchToFrontD1Ev 79 | 80 | __ZTV14SystemExecutor 81 | __ZTV11OmcExecutor 82 | __ZN11OmcExecutor19ReceiveNotificationEPv 83 | 84 | 85 | __Z28CreateOutputWindowControllerRK20OutputWindowSettingsP19OutputWindowHandler 86 | __Z29ReleaseOutputWindowControllerPv 87 | __Z22OMCOutputWindowSetTextPvPK10__CFString 88 | __Z25OMCOutputWindowAppendTextPvPK10__CFString 89 | __Z30OMCOutputWindowScheduleClosingPvd 90 | -------------------------------------------------------------------------------- /AbracodeFramework/AbracodeFrameworkVersion.c: -------------------------------------------------------------------------------- 1 | /* 2 | * AbracodeFrameworkVersion.c 3 | * 4 | * Weak linking support for Abracode.framework 5 | * Compile this file in your project and then call GetAbracodeFrameworkVersion to find out if the framework is installed 6 | * 7 | * 8 | */ 9 | 10 | #include 11 | 12 | extern UInt32 OMCGetCurrentVersion(void) __attribute__((weak_import)); 13 | 14 | UInt32 GetAbracodeFrameworkVersion() 15 | { 16 | if(OMCGetCurrentVersion != NULL) 17 | return OMCGetCurrentVersion(); 18 | 19 | CFOptionFlags responseFlags = 0; 20 | /*SInt32 isSuccessfull = */(void)CFUserNotificationDisplayAlert ( 21 | 0.0, //timeout 22 | kCFUserNotificationStopAlertLevel, 23 | NULL, //iconURL 24 | NULL, //soundURL 25 | NULL, //localizationURL 26 | CFSTR("Missing Abracode.framework"), //alertHeader 27 | CFSTR("This app requires Abracode.framework installed by OnMyCommand. Please go to abracode.com to download it."), 28 | CFSTR("Go"), 29 | CFSTR("Cancel"), 30 | NULL, //otherButtonTitle, 31 | &responseFlags ); 32 | 33 | if( (responseFlags & 0x03) == kCFUserNotificationDefaultResponse )//Go online button 34 | { 35 | system("/usr/bin/open 'http://www.abracode.com/free/cmworkshop/on_my_command.html'"); 36 | } 37 | 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /AbracodeFramework/Abracode_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Abracode' target in the 'Abracode' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /AbracodeFramework/CMUtils/CMUtilsAEFile.cp: -------------------------------------------------------------------------------- 1 | //************************************************************************************** 2 | // Filename: CMUtilsAEFile.cp 3 | // Part of Contextual Menu Workshop by Abracode Inc. 4 | // http://free.abracode.com/cmworkshop/ 5 | // 6 | // Copyright � 2002-2004 Abracode, Inc. All rights reserved. 7 | // 8 | // Description: static utilities for Contextual Menu Plugins 9 | // 10 | // 11 | //************************************************************************************** 12 | 13 | #include "CMUtils.h" 14 | #include "StAEDesc.h" 15 | #include 16 | 17 | CFURLRef CopyURLFromFileURLAEDesc(const AEDesc &inDesc) 18 | { 19 | Size byteCount = ::AEGetDescDataSize( &inDesc ); 20 | std::vector newBuffer(byteCount); 21 | if( ::AEGetDescData(&inDesc, newBuffer.data(), byteCount) != noErr) 22 | return nullptr; 23 | CFURLRef outURL = CFURLCreateWithBytes(kCFAllocatorDefault, (const UInt8 *)newBuffer.data(), newBuffer.size(), kCFStringEncodingUTF8, nullptr); 24 | return outURL; 25 | } 26 | 27 | CFURLRef 28 | CMUtils::CopyURL(const AEDesc &inDesc) 29 | { 30 | if( (inDesc.descriptorType == typeFileURL) && (inDesc.dataHandle != nullptr) ) 31 | {//no need to coerce 32 | TRACE_CSTR("\tCMUtils::CopyURL without coercing...\n" ); 33 | return CopyURLFromFileURLAEDesc(inDesc); 34 | } 35 | else if( (inDesc.descriptorType != typeNull) && (inDesc.dataHandle != nullptr) ) 36 | { 37 | StAEDesc coercedRef; 38 | OSErr err = ::AECoerceDesc( &inDesc, typeFileURL, coercedRef ); 39 | if(err == noErr) 40 | { 41 | TRACE_CSTR("\tCMUtils::CopyURL with coercing...\n" ); 42 | return CopyURLFromFileURLAEDesc(coercedRef); 43 | } 44 | } 45 | return nullptr; 46 | } 47 | -------------------------------------------------------------------------------- /AbracodeFramework/CMUtils/CMUtilsBundle.cp: -------------------------------------------------------------------------------- 1 | //************************************************************************************** 2 | // Filename: CMUtilsBundleResource.cp 3 | // Part of Contextual Menu Workshop by Abracode Inc. 4 | // http://free.abracode.com/cmworkshop/ 5 | // 6 | // Copyright © 2002-2007 Abracode, Inc. All rights reserved. 7 | // 8 | // Description: static utilities for Contextual Menu Plugins 9 | // 10 | // 11 | //************************************************************************************** 12 | 13 | #include "CMUtils.h" 14 | #include "CFObj.h" 15 | #include "ACFType.h" 16 | 17 | CFBundleRef 18 | CMUtils::CFBundleCreate(CFURLRef inBundleURL) 19 | { 20 | if(inBundleURL == nullptr) 21 | return nullptr; 22 | 23 | CFObj absoluteBundleURL = CFURLCopyAbsoluteURL(inBundleURL); 24 | if(absoluteBundleURL == nullptr) 25 | return nullptr; 26 | 27 | return ::CFBundleCreate(kCFAllocatorDefault, absoluteBundleURL); 28 | } 29 | -------------------------------------------------------------------------------- /AbracodeFramework/CMUtils/SubmenuTree.h: -------------------------------------------------------------------------------- 1 | //************************************************************************************** 2 | // Filename: SubmenuTree.h 3 | // Copyright � 2005 Abracode. All rights reserved. 4 | // 5 | // Description: 6 | // 7 | //************************************************************************************** 8 | // Revision History: 9 | // Thursday, March 10, 2005 - Original 10 | //************************************************************************************** 11 | 12 | #pragma once 13 | 14 | #include 15 | 16 | class AbstractMenuItem 17 | { 18 | public: 19 | virtual ~AbstractMenuItem() { }; 20 | virtual bool IsSubmenu() = 0; 21 | }; 22 | 23 | class SubmenuItem : public AbstractMenuItem 24 | { 25 | public: 26 | SubmenuItem(CFURLRef inPath, CFStringRef inName); 27 | virtual ~SubmenuItem(); 28 | virtual bool IsSubmenu() { return true; } 29 | 30 | AEDescList aeItemList; 31 | CFURLRef path; 32 | CFStringRef name; 33 | // CFMutableArrayRef submenuList;//objects not owned 34 | CFMutableArrayRef itemList; // a list of command items or submenu items records 35 | Boolean isAppended; 36 | class SubmenuItem *previousItem; 37 | }; 38 | 39 | class CommandMenuItem : public AbstractMenuItem 40 | { 41 | public: 42 | CommandMenuItem(CFStringRef inSubmenuPathString, 43 | CFStringRef inItemName, 44 | SInt32 inCommandID, 45 | MenuItemAttributes attributes, 46 | UInt32 modifiers); 47 | virtual ~CommandMenuItem(); 48 | virtual bool IsSubmenu() { return false; } 49 | 50 | CFStringRef submenuPathString; 51 | CFStringRef itemName; 52 | SInt32 commandID; 53 | MenuItemAttributes attributes; 54 | UInt32 modifiers; 55 | }; 56 | 57 | 58 | class SubmenuTree 59 | { 60 | public: 61 | SubmenuTree(AEDescList* inRootMenu); 62 | virtual ~SubmenuTree(); 63 | 64 | SubmenuItem * FindOrAddSubmenu(CFURLRef urlRef); 65 | SubmenuItem * FindSubmenu(CFURLRef inPath); 66 | OSStatus AddMenuItem( 67 | CFStringRef inSubmenuPathString, 68 | CFStringRef inItemName, 69 | SInt32 inCommandID, 70 | MenuItemAttributes attributes, 71 | UInt32 modifiers); 72 | 73 | void BuildSubmenuTree(); 74 | void AppendSubmenu(SubmenuItem *inSubmenu); 75 | void AddSubmenusToAEList(SubmenuItem* currLevel); 76 | 77 | protected: 78 | SubmenuItem *mSubmenuList; //flat chain of SubmenuItems for easy search. items not owned 79 | SubmenuItem *mRootItem;//items owned 80 | 81 | //cached for better performance when adding mutiple items to the same submenu 82 | //never retained so do not release 83 | // SubmenuItem mLastItem; 84 | 85 | private: 86 | // Defensive programming. No copy constructor nor operator= 87 | SubmenuTree(const SubmenuTree&); 88 | SubmenuTree& operator=(const SubmenuTree&); 89 | }; 90 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMC Controls Properties.txt: -------------------------------------------------------------------------------- 1 | OMCBox: 2 | Number tag 3 | 4 | OMCButton: 5 | String commandID; 6 | String mappedOnValue; 7 | String mappedOffValue; 8 | String escapingMode; 9 | 10 | OMCButtonCell: 11 | String commandID; 12 | String mappedOnValue; 13 | String mappedOffValue; 14 | String escapingMode; 15 | 16 | OMCComboBox: 17 | String commandID; 18 | String escapingMode; 19 | 20 | OMCIKImageView: 21 | Number tag; 22 | String escapingMode; 23 | 24 | OMCImageView: 25 | String commandID; 26 | String escapingMode; 27 | 28 | OMCMenuItem: 29 | String commandID; 30 | String mappedValue; 31 | String escapingMode; 32 | 33 | OMCPDFView: 34 | Number tag; 35 | String escapingMode; 36 | 37 | OMCPopUpButton: 38 | String commandID; 39 | 40 | OMCProgressIndicator: 41 | Number tag; 42 | 43 | OMCQCView: 44 | String commandID; 45 | Number tag; 46 | String escapingMode; 47 | 48 | OMCQTMovieView: 49 | Number tag; 50 | String escapingMode; 51 | 52 | OMCSearchField: 53 | String commandID; 54 | String escapingMode; 55 | 56 | OMCSecureTextField: 57 | String commandID; 58 | String escapingMode; 59 | 60 | OMCSlider: 61 | String commandID; 62 | 63 | OMCTableView: 64 | String selectionCommandID; 65 | String doubleClickCommandID; 66 | String combinedSelectionPrefix; 67 | String combinedSelectionSuffix; 68 | String combinedSelectionSeparator; 69 | String multipleColumnPrefix; 70 | String multipleColumnSuffix; 71 | String multipleColumnSeparator; 72 | String escapingMode; 73 | 74 | OMCTextField: 75 | String commandID; 76 | String escapingMode; 77 | 78 | OMCTextView: 79 | Number tag; 80 | String escapingMode; 81 | 82 | OMCTextView: 83 | Number tag; 84 | String escapingMode; 85 | 86 | OMCView: 87 | Number tag; 88 | 89 | OMCWebView: 90 | Number tag; 91 | String escapingMode; 92 | 93 | escapingMode predefined strings: 94 | esc_none 95 | esc_with_backslash 96 | esc_with_percent 97 | esc_with_percent_all 98 | esc_for_applescript 99 | esc_wrap_with_single_quotes_for_shell 100 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCBox.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCBox.h 3 | */ 4 | 5 | #import 6 | 7 | IB_DESIGNABLE 8 | @interface OMCBox : NSBox 9 | { 10 | BOOL _enabled; 11 | } 12 | 13 | @property (nonatomic, readwrite) IBInspectable NSInteger tag; 14 | @property (nonatomic, readwrite) IBInspectable BOOL enabled; 15 | 16 | @end //OMCBox 17 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCBox.m: -------------------------------------------------------------------------------- 1 | /* 2 | OMCBox.m 3 | */ 4 | 5 | #import "OMCBox.h" 6 | #import "OMCView.h" 7 | 8 | @implementation OMCBox 9 | 10 | @synthesize tag; 11 | @synthesize enabled = _enabled; 12 | 13 | - (id)init 14 | { 15 | self = [super init]; 16 | if(self == nil) 17 | return nil; 18 | 19 | _enabled = YES; 20 | 21 | return self; 22 | } 23 | 24 | - (id)initWithCoder:(NSCoder *)coder 25 | { 26 | self = [super initWithCoder:coder]; 27 | if(self == nil) 28 | return nil; 29 | 30 | _enabled = YES; 31 | 32 | return self; 33 | } 34 | 35 | - (void)setEnabled:(BOOL)flag 36 | { 37 | if(_enabled != flag) 38 | { 39 | _enabled = flag; 40 | [OMCView setEnabled:_enabled inView:self]; 41 | } 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCButton.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCButton.h 3 | */ 4 | 5 | #import 6 | 7 | IB_DESIGNABLE 8 | @interface OMCButton : NSButton 9 | { 10 | } 11 | 12 | @property (nonatomic, retain) IBInspectable NSString * commandID; 13 | @property (nonatomic, retain) IBInspectable NSString * mappedOnValue; 14 | @property (nonatomic, retain) IBInspectable NSString * mappedOffValue; 15 | @property (nonatomic, retain) IBInspectable NSString * escapingMode; 16 | @property (nonatomic) BOOL IBInspectable acceptFileDrop; 17 | @property (nonatomic) BOOL IBInspectable acceptTextDrop; 18 | @property (nonatomic, retain) id droppedItems; //could be NSArray * for list of files or NSString * for text 19 | 20 | @end 21 | 22 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCButtonCell.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCButtonCell.h 3 | */ 4 | 5 | #import 6 | 7 | IB_DESIGNABLE 8 | @interface OMCButtonCell : NSButtonCell 9 | { 10 | } 11 | 12 | @property (nonatomic, retain) IBInspectable NSString * commandID; 13 | @property (nonatomic, retain) IBInspectable NSString * mappedOnValue; 14 | @property (nonatomic, retain) IBInspectable NSString * mappedOffValue; 15 | @property (nonatomic, retain) IBInspectable NSString * escapingMode; 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCButtonCell.m: -------------------------------------------------------------------------------- 1 | /* 2 | OMCButtonCell.m 3 | */ 4 | 5 | #import "OMCButtonCell.h" 6 | #import 7 | 8 | @implementation OMCButtonCell 9 | 10 | @synthesize commandID; 11 | @synthesize mappedOnValue; 12 | @synthesize mappedOffValue; 13 | @synthesize escapingMode; 14 | 15 | - (id)init 16 | { 17 | self = [super init]; 18 | if(self == nil) 19 | return nil; 20 | 21 | self.escapingMode = @"esc_none"; 22 | 23 | return self; 24 | } 25 | 26 | - (id)initWithCoder:(NSCoder *)coder 27 | { 28 | self = [super initWithCoder:coder]; 29 | if(self == nil) 30 | return nil; 31 | 32 | self.escapingMode = @"esc_none"; 33 | 34 | return self; 35 | } 36 | 37 | - (void)dealloc 38 | { 39 | self.commandID = nil; 40 | self.mappedOnValue = nil; 41 | self.mappedOffValue = nil; 42 | self.escapingMode = nil; 43 | [super dealloc]; 44 | } 45 | 46 | //a subclass of NSCell must implement copying 47 | 48 | - (id)copyWithZone:(NSZone *)zone 49 | { 50 | OMCButtonCell *objCopy = [super copyWithZone:zone]; 51 | 52 | [objCopy.commandID retain]; 53 | [objCopy.mappedOnValue retain]; 54 | [objCopy.mappedOffValue retain]; 55 | [objCopy.escapingMode retain]; 56 | 57 | return objCopy; 58 | } 59 | 60 | //overriding NSControl methods to include mapped values 61 | 62 | - (NSString *)stringValue 63 | { 64 | int intValue = [self intValue]; 65 | if( (intValue > 0) && (self.mappedOnValue != nil) ) 66 | return self.mappedOnValue; 67 | else if( (intValue == 0) && (mappedOffValue != nil) ) 68 | return self.mappedOffValue; 69 | 70 | return [super stringValue]; 71 | } 72 | 73 | - (void)setStringValue:(NSString *)aString 74 | { 75 | if(aString == nil) 76 | return; 77 | 78 | if([self.mappedOnValue isEqualToString:aString]) 79 | { 80 | [self setIntValue:1]; 81 | } 82 | else if([self.mappedOffValue isEqualToString:aString]) 83 | { 84 | [self setIntValue:0]; 85 | } 86 | else 87 | { 88 | [super setStringValue:aString]; 89 | } 90 | } 91 | 92 | @end 93 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCComboBox.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCComboBox.h 3 | */ 4 | 5 | #import 6 | 7 | IB_DESIGNABLE 8 | @interface OMCComboBox : NSComboBox 9 | { 10 | NSString * _lastValue; 11 | } 12 | 13 | @property (nonatomic, retain) IBInspectable NSString * commandID; 14 | @property (nonatomic, retain) IBInspectable NSString * escapingMode; 15 | 16 | -(BOOL)shouldExecuteAction; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCComboBox.m: -------------------------------------------------------------------------------- 1 | /* 2 | OMCComboBox.m 3 | */ 4 | 5 | #import "OMCComboBox.h" 6 | 7 | @implementation OMCComboBox 8 | 9 | @synthesize commandID; 10 | @synthesize escapingMode; 11 | 12 | - (id)init 13 | { 14 | self = [super init]; 15 | if(self == nil) 16 | return nil; 17 | 18 | self.escapingMode = @"esc_none"; 19 | 20 | return self; 21 | } 22 | 23 | - (id)initWithCoder:(NSCoder *)coder 24 | { 25 | self = [super initWithCoder:coder]; 26 | if(self == nil) 27 | return nil; 28 | 29 | self.escapingMode = @"esc_none"; 30 | 31 | return self; 32 | } 33 | 34 | 35 | - (void)dealloc 36 | { 37 | self.commandID = nil; 38 | self.escapingMode = nil; 39 | [_lastValue release]; 40 | [super dealloc]; 41 | } 42 | 43 | /* 44 | - (BOOL)prepareForDragOperation:(id < NSDraggingInfo >)sender 45 | { 46 | BOOL isAccepted = [super prepareForDragOperation:sender]; 47 | if(isAccepted) 48 | NSLog(@"Drag accepted by OMCTextField = 0x%x", (void *)self); 49 | else 50 | NSLog(@"Drag rejected by OMCTextField = 0x%x", (void *)self); 51 | 52 | return isAccepted; 53 | } 54 | */ 55 | 56 | //do not execute the action if the value string has not changed since last execution 57 | -(BOOL)shouldExecuteAction 58 | { 59 | BOOL shouldExecute = YES; 60 | NSString *newValue = [self stringValue]; 61 | if( _lastValue != NULL ) 62 | { 63 | shouldExecute = ![_lastValue isEqualToString:newValue]; 64 | [_lastValue release]; 65 | } 66 | 67 | _lastValue = [newValue retain]; 68 | 69 | return shouldExecute; 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCGridView.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCGridView.h 3 | */ 4 | 5 | #import 6 | 7 | IB_DESIGNABLE 8 | @interface OMCGridView : NSGridView 9 | { 10 | BOOL _enabled; 11 | } 12 | 13 | @property (nonatomic, readwrite) IBInspectable NSInteger tag; 14 | @property (nonatomic, readwrite) IBInspectable BOOL enabled; 15 | 16 | @end //OMCGridView 17 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCGridView.m: -------------------------------------------------------------------------------- 1 | /* 2 | OMCGridView.m 3 | */ 4 | 5 | #import "OMCGridView.h" 6 | #import "OMCView.h" 7 | 8 | @implementation OMCGridView 9 | 10 | @synthesize tag; 11 | @synthesize enabled = _enabled; 12 | 13 | - (id)init 14 | { 15 | self = [super init]; 16 | if(self == nil) 17 | return nil; 18 | 19 | _enabled = YES; 20 | 21 | return self; 22 | } 23 | 24 | - (id)initWithCoder:(NSCoder *)coder 25 | { 26 | self = [super initWithCoder:coder]; 27 | if(self == nil) 28 | return nil; 29 | 30 | _enabled = YES; 31 | 32 | return self; 33 | } 34 | 35 | - (void)setEnabled:(BOOL)flag 36 | { 37 | if(_enabled != flag) 38 | { 39 | _enabled = flag; 40 | [OMCView setEnabled:_enabled inView:self]; 41 | } 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCIKImageView.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCIKImageView.h 3 | */ 4 | 5 | #import 6 | #import 7 | 8 | IB_DESIGNABLE 9 | @interface OMCIKImageView : IKImageView 10 | { 11 | } 12 | 13 | //no tag in IKImageView - OMC extension 14 | @property (nonatomic, readwrite) IBInspectable NSInteger tag; 15 | @property (nonatomic, retain) IBInspectable NSString * escapingMode; 16 | 17 | - (NSString *)stringValue; 18 | - (void)setStringValue:(NSString *)aString; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCIKImageView.m: -------------------------------------------------------------------------------- 1 | /* 2 | OMCIKImageView.m 3 | */ 4 | 5 | #import "OMCIKImageView.h" 6 | 7 | @implementation OMCIKImageView 8 | 9 | @synthesize tag; 10 | @synthesize escapingMode; 11 | 12 | - (id)init 13 | { 14 | self = [super init]; 15 | if(self == nil) 16 | return nil; 17 | 18 | self.escapingMode = @"esc_none"; 19 | 20 | return self; 21 | } 22 | 23 | - (id)initWithCoder:(NSCoder *)coder 24 | { 25 | self = [super initWithCoder:coder]; 26 | if(self == nil) 27 | return nil; 28 | 29 | self.escapingMode = @"esc_none"; 30 | 31 | return self; 32 | } 33 | 34 | - (void)dealloc 35 | { 36 | self.escapingMode = nil; 37 | [super dealloc]; 38 | } 39 | 40 | 41 | - (NSString *)stringValue 42 | { 43 | return nil;//todo. most likely we will need to hold member variable 44 | } 45 | 46 | - (void)setStringValue:(NSString *)aString 47 | { 48 | NSURL *imageURL = [NSURL fileURLWithPath:aString]; 49 | if(imageURL == nil) 50 | return; 51 | 52 | [self setImageWithURL:imageURL]; 53 | } 54 | 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCImageView.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCImageView.h 3 | */ 4 | 5 | #import 6 | #import 7 | 8 | IB_DESIGNABLE 9 | @interface OMCImageView : NSImageView 10 | { 11 | NSString * _imagePath; 12 | } 13 | 14 | @property (nonatomic, retain) IBInspectable NSString * commandID; 15 | @property (nonatomic, retain) IBInspectable NSString * escapingMode; 16 | 17 | - (NSString *)stringValue; 18 | - (void)setStringValue:(NSString *)aString; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCImageView.m: -------------------------------------------------------------------------------- 1 | /* 2 | OMCImageView.m 3 | */ 4 | 5 | #import "OMCImageView.h" 6 | 7 | @implementation OMCImageView 8 | 9 | @synthesize commandID; 10 | @synthesize escapingMode; 11 | 12 | - (id)init 13 | { 14 | self = [super init]; 15 | if(self == nil) 16 | return nil; 17 | 18 | self.escapingMode = @"esc_none"; 19 | 20 | return self; 21 | } 22 | 23 | - (id)initWithCoder:(NSCoder *)coder 24 | { 25 | self = [super initWithCoder:coder]; 26 | if(self == nil) 27 | return nil; 28 | 29 | self.escapingMode = @"esc_none"; 30 | 31 | return self; 32 | } 33 | 34 | - (void)dealloc 35 | { 36 | self.escapingMode = nil; 37 | self.commandID = nil; 38 | [_imagePath release]; 39 | [super dealloc]; 40 | } 41 | 42 | //override NSControl methods 43 | - (NSString *)stringValue 44 | { 45 | return _imagePath; 46 | } 47 | 48 | - (void)setStringValue:(NSString *)aString 49 | { 50 | // NSLog(@"image name = %@", [[self image] name]); 51 | 52 | if(_imagePath != nil) 53 | { 54 | [_imagePath release]; 55 | _imagePath = nil; 56 | } 57 | _imagePath = aString; 58 | 59 | if(_imagePath != nil) 60 | { 61 | [_imagePath retain]; 62 | 63 | NSImage *myImage = [[NSImage alloc] initWithContentsOfFile:_imagePath]; 64 | 65 | if(myImage == NULL) 66 | NSLog(@"OMCImageView failed to load image at \"%@\"", _imagePath); 67 | [self setImage:myImage]; 68 | 69 | // NSLog(@"image name = %@", [myImage name]); 70 | 71 | [myImage release]; 72 | } 73 | else 74 | { 75 | [self setImage:NULL]; 76 | } 77 | } 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCMenuItem.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCMenuItem.h 3 | */ 4 | 5 | #import 6 | 7 | IB_DESIGNABLE 8 | @interface OMCMenuItem : NSMenuItem 9 | { 10 | } 11 | 12 | @property (nonatomic, retain) IBInspectable NSString * commandID; 13 | @property (nonatomic, retain) IBInspectable NSString * mappedValue; 14 | @property (nonatomic, retain) IBInspectable NSString * escapingMode; 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCMenuItem.m: -------------------------------------------------------------------------------- 1 | /* 2 | OMCMenuItem.m 3 | */ 4 | 5 | #import "OMCMenuItem.h" 6 | 7 | @implementation OMCMenuItem 8 | 9 | @synthesize commandID; 10 | @synthesize mappedValue; 11 | @synthesize escapingMode; 12 | 13 | - (id)init 14 | { 15 | self = [super init]; 16 | if(self == nil) 17 | return nil; 18 | 19 | self.escapingMode = @"esc_none"; 20 | 21 | return self; 22 | } 23 | 24 | - (id)initWithCoder:(NSCoder *)coder 25 | { 26 | self = [super initWithCoder:coder]; 27 | if(self == nil) 28 | return nil; 29 | 30 | self.escapingMode = @"esc_none"; 31 | 32 | return self; 33 | } 34 | 35 | - (id)initWithTitle:(NSString *)itemName action:(SEL)anAction keyEquivalent:(NSString *)charCode 36 | { 37 | self = [super initWithTitle:itemName action:anAction keyEquivalent:charCode]; 38 | if(self == nil) 39 | return nil; 40 | 41 | self.escapingMode = @"esc_none"; 42 | 43 | return self; 44 | } 45 | 46 | - (void)dealloc 47 | { 48 | self.commandID = nil; 49 | self.mappedValue = nil; 50 | self.escapingMode = nil; 51 | [super dealloc]; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCPDFView.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCPDFView.h 3 | */ 4 | 5 | #import 6 | #import 7 | 8 | IB_DESIGNABLE 9 | @interface OMCPDFView : PDFView 10 | { 11 | } 12 | 13 | @property (nonatomic, readwrite) IBInspectable NSInteger tag; 14 | @property (nonatomic, retain) IBInspectable NSString * escapingMode; 15 | 16 | - (NSString *)stringValue; 17 | - (void)setStringValue:(NSString *)aString; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCPDFView.m: -------------------------------------------------------------------------------- 1 | /* 2 | OMCPDFView.m 3 | */ 4 | 5 | #import "OMCPDFView.h" 6 | 7 | @implementation OMCPDFView 8 | 9 | @synthesize tag; 10 | @synthesize escapingMode; 11 | 12 | - (id)init 13 | { 14 | self = [super init]; 15 | if(self == NULL) 16 | return NULL; 17 | self.escapingMode = @"esc_none"; 18 | return self; 19 | } 20 | 21 | - (void)dealloc 22 | { 23 | [escapingMode release]; 24 | [super dealloc]; 25 | } 26 | 27 | //legacy encoder/decoder support - custom control data no longer serialized into nibs 28 | //custom properties get set later on nib load by calling proprty setters 29 | 30 | - (id)initWithCoder:(NSCoder *)coder 31 | { 32 | self = [super initWithCoder:coder]; 33 | if(self == nil) 34 | return nil; 35 | 36 | self.escapingMode = @"esc_none"; 37 | 38 | return self; 39 | } 40 | 41 | - (NSString *)stringValue 42 | { 43 | PDFDocument *pdfDoc = [self document]; 44 | if(pdfDoc == nil) 45 | return nil; 46 | 47 | NSURL *pdfURL = [pdfDoc documentURL]; 48 | if(pdfURL == nil) 49 | return nil; 50 | 51 | return [pdfURL path]; 52 | } 53 | 54 | - (void)setStringValue:(NSString *)aString 55 | { 56 | if(aString == nil) 57 | return; 58 | 59 | NSURL *pdfURL = [NSURL fileURLWithPath:aString]; 60 | if(pdfURL == nil) 61 | return; 62 | 63 | PDFDocument *pdfDoc = [[PDFDocument alloc] initWithURL:pdfURL]; 64 | if(pdfDoc == nil) 65 | return; 66 | 67 | [self setDocument:pdfDoc]; 68 | 69 | [pdfDoc release]; 70 | } 71 | 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCPopUpButton.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCPopUpButton.h 3 | */ 4 | 5 | #import 6 | 7 | IB_DESIGNABLE 8 | @interface OMCPopUpButton : NSPopUpButton 9 | { 10 | } 11 | 12 | @property (nonatomic, retain) IBInspectable NSString * commandID; 13 | 14 | //no setter, gets value from currently selected menu item 15 | - (NSString *)escapingMode; 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCPopUpButton.m: -------------------------------------------------------------------------------- 1 | /* 2 | OMCPopUpButton.m 3 | */ 4 | 5 | #import "OMCPopUpButton.h" 6 | #import "OMCMenuItem.h" 7 | 8 | @implementation OMCPopUpButton 9 | 10 | @synthesize commandID; 11 | 12 | - (void)dealloc 13 | { 14 | self.commandID = nil; 15 | [super dealloc]; 16 | } 17 | 18 | - (NSString *)escapingMode 19 | { 20 | NSMenuItem *selItem = [self selectedItem]; 21 | if( selItem != NULL ) 22 | { 23 | if( [selItem respondsToSelector:@selector(escapingMode)] ) 24 | { 25 | NSString *escMode = [selItem performSelector:@selector(escapingMode)]; 26 | if( escMode != NULL ) 27 | return escMode; 28 | } 29 | } 30 | 31 | return @"esc_none"; 32 | } 33 | 34 | - (NSString *)stringValue 35 | { 36 | NSMenuItem *selItem = [self selectedItem]; 37 | if( selItem != NULL ) 38 | { 39 | if( [selItem respondsToSelector:@selector(mappedValue)] ) 40 | { 41 | //OMCMenuItem responds to that and may have a mapping 42 | NSString *mappedValue = [selItem performSelector:@selector(mappedValue)]; 43 | if( mappedValue != NULL ) 44 | return mappedValue; 45 | } 46 | //default implementation returns selected menu item number. OMC returns menu item string 47 | return [selItem title]; 48 | } 49 | 50 | return [super stringValue]; 51 | } 52 | 53 | //do the mapping here or fall back to NSPopUpButton implementation 54 | - (void)selectItemWithTitle:(NSString *)title 55 | { 56 | NSArray *itemArray = [self itemArray]; 57 | if( (itemArray == NULL) || (title == NULL) ) 58 | return; 59 | 60 | int itemCount = [itemArray count]; 61 | int itemIndex; 62 | for(itemIndex = 0; itemIndex < itemCount; itemIndex++) 63 | { 64 | NSMenuItem *menuItem = [itemArray objectAtIndex:itemIndex]; 65 | if( (menuItem != NULL) && [menuItem respondsToSelector:@selector(mappedValue)] ) 66 | { 67 | NSString *mappedValue = [menuItem performSelector:@selector(mappedValue)]; 68 | if( (mappedValue != NULL) && [mappedValue isEqualToString:title] ) 69 | { 70 | [self selectItemAtIndex:itemIndex]; 71 | return; 72 | } 73 | } 74 | } 75 | 76 | return [super selectItemWithTitle:title]; 77 | } 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCProgressIndicator.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCProgressIndicator.h 3 | */ 4 | 5 | #import 6 | 7 | IB_DESIGNABLE 8 | @interface OMCProgressIndicator : NSProgressIndicator 9 | { 10 | } 11 | 12 | @property (nonatomic, readwrite) IBInspectable NSInteger tag; 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCProgressIndicator.m: -------------------------------------------------------------------------------- 1 | /* 2 | OMCProgressIndicator.m 3 | */ 4 | 5 | #import "OMCProgressIndicator.h" 6 | 7 | @implementation OMCProgressIndicator 8 | 9 | @synthesize tag; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCQCView.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCQCView.h 3 | */ 4 | 5 | #import 6 | #import 7 | 8 | IB_DESIGNABLE 9 | @interface OMCQCView : QCView 10 | { 11 | id _omcTarget; 12 | SEL _omcTargetSelector; 13 | NSString * _compositionPath; 14 | } 15 | 16 | - (id)target; 17 | - (void)setTarget:(id)anObject; 18 | 19 | - (void)setAction:(SEL)aSelector; 20 | 21 | @property (nonatomic, retain) IBInspectable NSString * commandID; 22 | @property (nonatomic, readwrite) IBInspectable NSInteger tag; 23 | @property (nonatomic, retain) IBInspectable NSString * escapingMode; 24 | 25 | - (NSString *)stringValue; 26 | - (void)setStringValue:(NSString *)aString; 27 | 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCQCView.mm: -------------------------------------------------------------------------------- 1 | /* 2 | OMCQCView.m 3 | */ 4 | 5 | #import "OMCQCView.h" 6 | #import "OMCDialogController.h" 7 | 8 | @implementation OMCQCView 9 | 10 | @synthesize commandID; 11 | @synthesize tag; 12 | @synthesize escapingMode; 13 | 14 | - (id)init 15 | { 16 | self = [super init]; 17 | if(self == nil) 18 | return nil; 19 | 20 | self.escapingMode = @"esc_none"; 21 | 22 | return self; 23 | } 24 | 25 | - (id)initWithCoder:(NSCoder *)coder 26 | { 27 | self = [super initWithCoder:coder]; 28 | if(self == nil) 29 | return nil; 30 | 31 | self.escapingMode = @"esc_none"; 32 | 33 | return self; 34 | } 35 | 36 | - (void)dealloc 37 | { 38 | self.escapingMode = nil; 39 | self.commandID = nil; 40 | [_compositionPath release]; 41 | [_omcTarget release]; 42 | [super dealloc]; 43 | } 44 | 45 | - (id)target 46 | { 47 | return _omcTarget; 48 | } 49 | 50 | - (void)setTarget:(id)anObject; 51 | { 52 | [anObject retain]; 53 | [_omcTarget release]; 54 | _omcTarget = anObject; 55 | } 56 | 57 | - (void)setAction:(SEL)aSelector 58 | { 59 | _omcTargetSelector = aSelector; 60 | } 61 | 62 | 63 | - (NSString *)stringValue 64 | { 65 | return _compositionPath; 66 | } 67 | 68 | - (void)setStringValue:(NSString *)aString 69 | { 70 | if(_compositionPath != nil) 71 | { 72 | [self stopRendering]; 73 | [self unloadComposition]; 74 | [_compositionPath release]; 75 | _compositionPath = nil; 76 | } 77 | 78 | if(aString == NULL) 79 | return; 80 | 81 | _compositionPath = [aString retain]; 82 | 83 | BOOL isOK = [self loadCompositionFromFile:_compositionPath]; 84 | if(!isOK) 85 | NSLog(@"OMCQCView failed to load composition at \"%@\"", _compositionPath); 86 | 87 | NSMutableDictionary* userInfo = [self userInfo]; 88 | if( (userInfo != NULL) && (_omcTarget != NULL) && [_omcTarget respondsToSelector:@selector(getCFContext)]) 89 | { 90 | id contextInfo = [_omcTarget getCFContext]; 91 | [userInfo setValue:contextInfo forKey:@"com.abracode.context"]; 92 | } 93 | 94 | [self setAutostartsRendering:YES]; 95 | [self setEventForwardingMask:NSEventMaskAny]; 96 | [self startRendering]; 97 | } 98 | 99 | - (BOOL) renderAtTime:(NSTimeInterval)time arguments:(NSDictionary*)arguments 100 | { 101 | BOOL isOK = [super renderAtTime:time arguments:arguments]; 102 | if(isOK) 103 | { 104 | NSMutableDictionary* userInfo = [self userInfo]; 105 | if(userInfo != NULL) 106 | { 107 | id subcommand = [userInfo objectForKey:@"com.abracode.omc.subcommandId"]; 108 | if( (subcommand != NULL) && [subcommand isKindOfClass:[NSString class]] ) 109 | { 110 | [self setCommandID: (NSString *)subcommand]; 111 | [userInfo removeObjectForKey:@"com.abracode.omc.subcommandId"];//we used it up, now remove from dictionary 112 | 113 | if( (_omcTarget != NULL) && (_omcTargetSelector != NULL) ) 114 | { 115 | [_omcTarget performSelector:_omcTargetSelector withObject:self]; // = [(OMCDialogController*)_omcTarget handleAction:self]; 116 | } 117 | } 118 | } 119 | } 120 | return isOK; 121 | } 122 | 123 | @end 124 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCQTMovieView.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCQTMovieView.h 3 | */ 4 | 5 | #import 6 | #import 7 | 8 | IB_DESIGNABLE 9 | @interface OMCQTMovieView : QTMovieView 10 | { 11 | } 12 | 13 | @property (nonatomic, readwrite) IBInspectable NSInteger tag; 14 | @property (nonatomic, retain) IBInspectable NSString * escapingMode; 15 | 16 | - (NSString *)stringValue; 17 | - (void)setStringValue:(NSString *)aString; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCQTMovieView.m: -------------------------------------------------------------------------------- 1 | /* 2 | OMCQTMovieView.m 3 | */ 4 | 5 | #import "OMCQTMovieView.h" 6 | 7 | @implementation OMCQTMovieView 8 | 9 | @synthesize tag; 10 | @synthesize escapingMode; 11 | 12 | - (id)init 13 | { 14 | self = [super init]; 15 | if(self == nil) 16 | return nil; 17 | 18 | self.escapingMode = @"esc_none"; 19 | 20 | return self; 21 | } 22 | 23 | - (id)initWithCoder:(NSCoder *)coder 24 | { 25 | self = [super initWithCoder:coder]; 26 | if(self == nil) 27 | return nil; 28 | 29 | self.escapingMode = @"esc_none"; 30 | 31 | return self; 32 | } 33 | 34 | - (void)dealloc 35 | { 36 | self.escapingMode = nil; 37 | [super dealloc]; 38 | } 39 | 40 | - (NSString *)stringValue 41 | { 42 | QTMovie *qtMovie = [self movie]; 43 | if(qtMovie == nil) 44 | return nil; 45 | 46 | NSURL *movieURL = [qtMovie attributeForKey:QTMovieURLAttribute]; 47 | if(movieURL == nil) 48 | return nil; 49 | 50 | return [movieURL path]; 51 | } 52 | 53 | - (void)setStringValue:(NSString *)aString 54 | { 55 | QTMovie *qtMovie = [QTMovie movieWithFile:aString error:NULL]; 56 | if(qtMovie == nil) 57 | return; 58 | 59 | [self setMovie:qtMovie]; 60 | } 61 | 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCSearchField.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCSearchField.h 3 | */ 4 | 5 | #import 6 | 7 | IB_DESIGNABLE 8 | @interface OMCSearchField : NSSearchField 9 | { 10 | } 11 | 12 | @property (nonatomic, retain) IBInspectable NSString * commandID; 13 | @property (nonatomic, retain) IBInspectable NSString * escapingMode; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCSearchField.m: -------------------------------------------------------------------------------- 1 | /* 2 | OMCSearchField.m 3 | */ 4 | 5 | #import "OMCSearchField.h" 6 | 7 | @implementation OMCSearchField 8 | 9 | @synthesize commandID; 10 | @synthesize escapingMode; 11 | 12 | - (id)init 13 | { 14 | self = [super init]; 15 | if(self == nil) 16 | return nil; 17 | 18 | self.escapingMode = @"esc_none"; 19 | 20 | return self; 21 | } 22 | 23 | - (id)initWithCoder:(NSCoder *)coder 24 | { 25 | self = [super initWithCoder:coder]; 26 | if(self == nil) 27 | return nil; 28 | 29 | self.escapingMode = @"esc_none"; 30 | 31 | return self; 32 | } 33 | 34 | - (void)dealloc 35 | { 36 | self.commandID = nil; 37 | self.escapingMode = nil; 38 | [super dealloc]; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCSecureTextField.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCSecureTextField.h 3 | */ 4 | 5 | #import 6 | 7 | IB_DESIGNABLE 8 | @interface OMCSecureTextField : NSSecureTextField 9 | { 10 | } 11 | 12 | @property (nonatomic, retain) IBInspectable NSString * commandID; 13 | @property (nonatomic, retain) IBInspectable NSString * escapingMode; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCSecureTextField.m: -------------------------------------------------------------------------------- 1 | /* 2 | OMCSecureTextField.m 3 | */ 4 | 5 | #import "OMCSecureTextField.h" 6 | 7 | @implementation OMCSecureTextField 8 | 9 | @synthesize commandID; 10 | @synthesize escapingMode; 11 | 12 | - (id)init 13 | { 14 | self = [super init]; 15 | if(self == nil) 16 | return nil; 17 | 18 | self.escapingMode = @"esc_none"; 19 | 20 | return self; 21 | } 22 | 23 | - (id)initWithCoder:(NSCoder *)coder 24 | { 25 | self = [super initWithCoder:coder]; 26 | if(self == nil) 27 | return nil; 28 | 29 | self.escapingMode = @"esc_none"; 30 | 31 | return self; 32 | } 33 | 34 | - (void)dealloc 35 | { 36 | self.commandID = nil; 37 | self.escapingMode = nil; 38 | [super dealloc]; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCSlider.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCSlider.h 3 | */ 4 | 5 | #import 6 | 7 | IB_DESIGNABLE 8 | @interface OMCSlider : NSSlider 9 | { 10 | } 11 | 12 | @property (nonatomic, retain) IBInspectable NSString * commandID; 13 | 14 | @end 15 | 16 | 17 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCSlider.m: -------------------------------------------------------------------------------- 1 | /* 2 | OMCSlider.m 3 | */ 4 | 5 | #import "OMCSlider.h" 6 | 7 | @implementation OMCSlider 8 | 9 | @synthesize commandID; 10 | 11 | - (void)dealloc 12 | { 13 | self.commandID = nil; 14 | [super dealloc]; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCTableView.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCTableView.h 3 | */ 4 | 5 | #import 6 | 7 | IB_DESIGNABLE 8 | @interface OMCTableView : NSTableView 9 | { 10 | } 11 | 12 | @property (nonatomic, retain) IBInspectable NSString * selectionCommandID; 13 | @property (nonatomic, retain) IBInspectable NSString * doubleClickCommandID; 14 | @property (nonatomic, retain) IBInspectable NSString * combinedSelectionPrefix; 15 | @property (nonatomic, retain) IBInspectable NSString * combinedSelectionSuffix; 16 | @property (nonatomic, retain) IBInspectable NSString * combinedSelectionSeparator; 17 | @property (nonatomic, retain) IBInspectable NSString * multipleColumnPrefix; 18 | @property (nonatomic, retain) IBInspectable NSString * multipleColumnSuffix; 19 | @property (nonatomic, retain) IBInspectable NSString * multipleColumnSeparator; 20 | @property (nonatomic, retain) IBInspectable NSString * escapingMode; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCTableView.m: -------------------------------------------------------------------------------- 1 | /* 2 | OMCTableView.m 3 | */ 4 | 5 | #import "OMCTableView.h" 6 | 7 | @implementation OMCTableView 8 | 9 | @synthesize selectionCommandID; 10 | @synthesize doubleClickCommandID; 11 | @synthesize combinedSelectionPrefix; 12 | @synthesize combinedSelectionSuffix; 13 | @synthesize combinedSelectionSeparator; 14 | @synthesize multipleColumnPrefix; 15 | @synthesize multipleColumnSuffix; 16 | @synthesize multipleColumnSeparator; 17 | @synthesize escapingMode; 18 | 19 | - (id)init 20 | { 21 | self = [super init]; 22 | if(self == nil) 23 | return nil; 24 | 25 | self.escapingMode = @"esc_none"; 26 | 27 | return self; 28 | } 29 | 30 | - (id)initWithCoder:(NSCoder *)coder 31 | { 32 | self = [super initWithCoder:coder]; 33 | if(self == nil) 34 | return nil; 35 | 36 | self.escapingMode = @"esc_none"; 37 | 38 | return self; 39 | } 40 | 41 | - (void)dealloc 42 | { 43 | self.selectionCommandID = nil; 44 | self.doubleClickCommandID = nil; 45 | self.combinedSelectionPrefix = nil; 46 | self.combinedSelectionSuffix = nil; 47 | self.combinedSelectionSeparator = nil; 48 | self.multipleColumnPrefix = nil; 49 | self.multipleColumnSuffix = nil; 50 | self.multipleColumnSeparator = nil; 51 | self.escapingMode = nil; 52 | 53 | [super dealloc]; 54 | } 55 | 56 | - (NSString *)stringValue 57 | { 58 | return [super stringValue]; 59 | } 60 | 61 | - (void)setStringValue:(NSString *)aString 62 | { 63 | if(aString == nil) 64 | return; 65 | 66 | [super setStringValue:aString]; 67 | } 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCTextField.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCTextField.h 3 | */ 4 | 5 | #import 6 | 7 | IB_DESIGNABLE 8 | @interface OMCTextField : NSTextField 9 | { 10 | } 11 | 12 | @property (nonatomic, retain) IBInspectable NSString * commandID; 13 | @property (nonatomic, retain) IBInspectable NSString * escapingMode; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCTextField.m: -------------------------------------------------------------------------------- 1 | /* 2 | OMCTextField.m 3 | */ 4 | 5 | #import "OMCTextField.h" 6 | 7 | @implementation OMCTextField 8 | 9 | @synthesize commandID; 10 | @synthesize escapingMode; 11 | 12 | - (id)init 13 | { 14 | self = [super init]; 15 | if(self == nil) 16 | return nil; 17 | 18 | self.escapingMode = @"esc_none"; 19 | 20 | return self; 21 | } 22 | 23 | //legacy encoder/decoder support - custom control data no longer serialized into nibs 24 | //custom properties get set later on nib load by calling proprty setters 25 | 26 | - (id)initWithCoder:(NSCoder *)coder 27 | { 28 | self = [super initWithCoder:coder]; 29 | if(self == nil) 30 | return nil; 31 | 32 | self.escapingMode = @"esc_none"; 33 | 34 | return self; 35 | } 36 | 37 | - (void)dealloc 38 | { 39 | self.commandID = nil; 40 | self.escapingMode = nil; 41 | [super dealloc]; 42 | } 43 | 44 | /* 45 | - (BOOL)prepareForDragOperation:(id < NSDraggingInfo >)sender 46 | { 47 | BOOL isAccepted = [super prepareForDragOperation:sender]; 48 | if(isAccepted) 49 | NSLog(@"Drag accepted by OMCTextField = 0x%x", (void *)self); 50 | else 51 | NSLog(@"Drag rejected by OMCTextField = 0x%x", (void *)self); 52 | 53 | return isAccepted; 54 | } 55 | */ 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCTextView.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCTextView.h 3 | */ 4 | 5 | #import 6 | 7 | IB_DESIGNABLE 8 | @interface OMCTextView : NSTextView 9 | { 10 | BOOL _enabled; 11 | NSColor *_savedTextColor;//before disabling save the color 12 | } 13 | 14 | @property (nonatomic, readwrite) IBInspectable NSInteger tag; 15 | @property (nonatomic, readwrite) BOOL enabled; 16 | @property (nonatomic, retain) IBInspectable NSString * escapingMode; 17 | 18 | - (NSString *)stringValue; 19 | - (void)setStringValue:(NSString *)aString; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCTextView.m: -------------------------------------------------------------------------------- 1 | /* 2 | OMCTextView.m 3 | */ 4 | 5 | #import "OMCTextView.h" 6 | #import "OMCView.h" 7 | 8 | @implementation OMCTextView 9 | 10 | @synthesize tag; 11 | @synthesize escapingMode; 12 | @synthesize enabled = _enabled; 13 | 14 | - (id)init 15 | { 16 | self = [super init]; 17 | if(self == nil) 18 | return nil; 19 | 20 | self.escapingMode = @"esc_none"; 21 | _enabled = YES; 22 | 23 | return self; 24 | } 25 | 26 | - (id)initWithCoder:(NSCoder *)coder 27 | { 28 | self = [super initWithCoder:coder]; 29 | if(self == nil) 30 | return nil; 31 | 32 | self.escapingMode = @"esc_none"; 33 | _enabled = YES; 34 | 35 | return self; 36 | } 37 | 38 | - (void)dealloc 39 | { 40 | self.escapingMode = nil; 41 | [_savedTextColor release]; 42 | [super dealloc]; 43 | } 44 | 45 | - (NSString *)stringValue 46 | { 47 | return [self string]; 48 | } 49 | 50 | - (void)setStringValue:(NSString *)aString 51 | { 52 | [self setString:aString]; 53 | } 54 | 55 | - (void)setEnabled:(BOOL)flag 56 | { 57 | if(_enabled != flag) 58 | { 59 | _enabled = flag; 60 | [self setSelectable:_enabled]; 61 | [self setEditable:_enabled]; 62 | if(_enabled) 63 | { 64 | if(_savedTextColor != nil) 65 | { 66 | [self setTextColor:_savedTextColor]; 67 | [_savedTextColor release]; 68 | _savedTextColor = nil; 69 | } 70 | else 71 | [self setTextColor: [NSColor controlTextColor]]; 72 | } 73 | else 74 | { 75 | [_savedTextColor release]; 76 | _savedTextColor = [[self textColor] retain]; 77 | [self setTextColor: [NSColor disabledControlTextColor]]; 78 | } 79 | } 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCView.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCView.h 3 | */ 4 | 5 | #import 6 | 7 | IB_DESIGNABLE 8 | @interface OMCView : NSView 9 | { 10 | BOOL _enabled; 11 | } 12 | 13 | @property (nonatomic, readwrite) IBInspectable NSInteger tag; 14 | @property (nonatomic, readwrite) BOOL enabled; 15 | 16 | //recursive enable/disable for all controls in a view 17 | + (void)setEnabled:(BOOL)flag inView:(id)inView; 18 | 19 | @end //OMCView 20 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCView.m: -------------------------------------------------------------------------------- 1 | /* 2 | OMCView.m 3 | */ 4 | 5 | #import "OMCView.h" 6 | #import "OMCTextView.h" 7 | #include "DebugSettings.h" 8 | 9 | @implementation OMCView 10 | 11 | @synthesize tag; 12 | @synthesize enabled = _enabled; 13 | 14 | - (id)init 15 | { 16 | self = [super init]; 17 | if(self == nil) 18 | return nil; 19 | 20 | _enabled = YES; 21 | return self; 22 | } 23 | 24 | - (id)initWithCoder:(NSCoder *)coder 25 | { 26 | self = [super initWithCoder:coder]; 27 | if(self == nil) 28 | return nil; 29 | 30 | _enabled = YES; 31 | 32 | return self; 33 | } 34 | 35 | - (void)setEnabled:(BOOL)flag 36 | { 37 | if(_enabled != flag) 38 | { 39 | _enabled = flag; 40 | [OMCView setEnabled:_enabled inView:self]; 41 | } 42 | } 43 | 44 | //recursive enable/disable for all controls in a view 45 | + (void)setEnabled:(BOOL)flag inView:(id)inView 46 | { 47 | //checking if inView responds to setEnabled: selector and calling it would result in infinite loop for OMCView 48 | //we check for classes that we know that respond to that selector instead 49 | 50 | if([inView isKindOfClass:[NSControl class] ]) 51 | { 52 | NSControl *theControl = (NSControl *)inView; 53 | [theControl setEnabled:flag]; 54 | } 55 | else if([inView isKindOfClass:[OMCTextView class] ]) //regular NSTextView does not support enable/disable but our subclass does 56 | { 57 | OMCTextView *textView = (OMCTextView *)inView; 58 | [textView setEnabled:flag]; 59 | } 60 | else if([inView isKindOfClass:[NSTabView class] ]) 61 | {//search tabs view recursively 62 | NSArray *tabViewsArray = [(NSTabView*)inView tabViewItems]; 63 | if(tabViewsArray != NULL) 64 | { 65 | NSUInteger tabCount = [tabViewsArray count]; 66 | NSUInteger tabIndex; 67 | for(tabIndex=0; tabIndex < tabCount; tabIndex++) 68 | { 69 | id oneTab = [tabViewsArray objectAtIndex:tabIndex]; 70 | if( (oneTab != NULL) && [oneTab isKindOfClass:[NSTabViewItem class]] ) 71 | { 72 | id viewObject = [(NSTabViewItem*)oneTab view]; 73 | if( (viewObject != NULL) && [viewObject isKindOfClass:[NSView class]] ) 74 | { 75 | [OMCView setEnabled:flag inView:viewObject]; 76 | } 77 | } 78 | } 79 | } 80 | } 81 | else if( [inView isKindOfClass:[NSView class] ] ) 82 | { 83 | //search subviews recursively 84 | NSArray *subViewsArray = [inView subviews]; 85 | if(subViewsArray != NULL) 86 | { 87 | int subIndex; 88 | int subCount = [subViewsArray count]; 89 | for(subIndex = 0; subIndex < subCount; subIndex++) 90 | { 91 | id viewObject = [subViewsArray objectAtIndex:subIndex]; 92 | if( (viewObject != NULL) && [viewObject isKindOfClass:[NSView class]] ) 93 | { 94 | [OMCView setEnabled:flag inView:viewObject]; 95 | } 96 | } 97 | } 98 | } 99 | else 100 | { 101 | DEBUG_CSTR("Unknown element type passed to OMCView setEnabled:inView:\n"); 102 | } 103 | } 104 | 105 | @end 106 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCWebKitView.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCWebKitView.h 3 | */ 4 | 5 | #import 6 | #import 7 | 8 | // Note that OMCWebKitView inherits from NSView and not WKWebView 9 | // When creating this control in nib file, insert "custom view", which is NSView 10 | // Then switch to class inspector and change the name to OMCWebKitView 11 | // When WKWebView is instantiated from nib it cannot be configured 12 | // For some strange reason Apple chose the design that the configuration cannot be changed 13 | // once the control is created. It effectively forces everyone to create WKWebView in code 14 | 15 | IB_DESIGNABLE 16 | @interface OMCWebKitView : NSView 17 | { 18 | WKWebView *_wkWebView; 19 | } 20 | 21 | @property (nonatomic, readwrite) IBInspectable NSInteger tag; 22 | @property (nonatomic, retain) IBInspectable NSString *escapingMode; 23 | @property (nonatomic, retain) IBInspectable NSString *javaScriptFile; 24 | @property (nonatomic, retain) IBInspectable NSString *URL; 25 | @property (nonatomic, weak) id target; 26 | @property (nonatomic) SEL action; 27 | @property (nonatomic, retain) NSString *commandID; 28 | @property (nonatomic, retain) NSString *elementID; 29 | 30 | - (NSString *)stringValue; 31 | - (void)setStringValue:(NSString *)aString; 32 | 33 | - (void)storeElementValuesIn:(NSMutableDictionary *)ioDict; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCWebView.h: -------------------------------------------------------------------------------- 1 | /* 2 | OMCWebView.h 3 | */ 4 | 5 | #import 6 | #import 7 | 8 | /* 9 | THIS CONTROL IS DEPRECATED 10 | USE OMCWebKitView INSTEAD 11 | */ 12 | 13 | 14 | IB_DESIGNABLE 15 | @interface OMCWebView : WebView 16 | { 17 | } 18 | 19 | @property (nonatomic, readwrite) IBInspectable NSInteger tag; 20 | @property (nonatomic, retain) IBInspectable NSString * escapingMode; 21 | 22 | - (NSString *)stringValue; 23 | - (void)setStringValue:(NSString *)aString; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /AbracodeFramework/CocoaControls/OMCWebView.m: -------------------------------------------------------------------------------- 1 | /* 2 | OMCWebView.m 3 | */ 4 | 5 | #import "OMCWebView.h" 6 | 7 | @implementation OMCWebView 8 | 9 | @synthesize tag; 10 | @synthesize escapingMode; 11 | 12 | - (id)init 13 | { 14 | self = [super init]; 15 | if(self == nil) 16 | return nil; 17 | 18 | self.escapingMode = @"esc_none"; 19 | 20 | return self; 21 | } 22 | 23 | - (void)dealloc 24 | { 25 | self.escapingMode = nil; 26 | [super dealloc]; 27 | } 28 | 29 | //legacy encoder/decoder support - custom control data no longer serialized into nibs 30 | //custom properties get set later on nib load by calling property setters 31 | 32 | - (id)initWithCoder:(NSCoder *)coder 33 | { 34 | self = [super initWithCoder:coder]; 35 | if(self == nil) 36 | return nil; 37 | 38 | self.escapingMode = @"esc_none"; 39 | 40 | return self; 41 | } 42 | 43 | - (NSString *)stringValue 44 | { 45 | return [self mainFrameURL]; 46 | } 47 | 48 | - (void)setStringValue:(NSString *)aString 49 | { 50 | [self setMainFrameURL:aString]; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /AbracodeFramework/DefaultExternBundle.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * DefaultExternBundle.cpp 3 | * OMCApplet 4 | * 5 | * Created by Tomasz Kukielka on 9/8/06. 6 | * Copyright 2006 Abracode. All rights reserved. 7 | * 8 | */ 9 | 10 | #include 11 | #include "DefaultExternBundle.h" 12 | #include "CMUtils.h" 13 | #include "CFObj.h" 14 | #include "ACFURL.h" 15 | 16 | 17 | extern "C" 18 | { 19 | 20 | CFURLRef 21 | CreateDefaultExternBundleURL(CFArrayRef inCommandName) 22 | { 23 | if(inCommandName == NULL) 24 | return NULL; 25 | 26 | CFObj staticName( ::CFStringCreateByCombiningStrings( kCFAllocatorDefault, inCommandName, CFSTR("") ) ); 27 | CFObj bundleName( ::CFStringCreateMutableCopy( kCFAllocatorDefault, ::CFStringGetLength(staticName) + 4, staticName) ); 28 | if(bundleName == NULL) 29 | return NULL; 30 | 31 | ::CFStringAppend( bundleName, CFSTR(".omc") ); 32 | 33 | CFObj appSupportURL( CopyApplicationSupportDirURL() ); 34 | if(appSupportURL == NULL) 35 | return NULL; 36 | 37 | CFObj omcSupportURL( ::CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault, appSupportURL, CFSTR("OnMyCommand"), true /*isDirectory*/) ); 38 | if(omcSupportURL == NULL) 39 | return NULL; 40 | 41 | return ::CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault, omcSupportURL, bundleName, true /*isDirectory*/); 42 | } 43 | 44 | 45 | //caller responsible for releasing the result if not NULL 46 | //look for ~/Libarary/Application Support/OnMyCommand/CommandName.omc bundle 47 | CFBundleRef 48 | CreateDefaultExternBundleRef(CFArrayRef inCommandName) 49 | { 50 | CFObj externBundleURL( CreateDefaultExternBundleURL(inCommandName) ); 51 | if(externBundleURL == NULL) 52 | return NULL; 53 | 54 | return CMUtils::CFBundleCreate(externBundleURL);//may be NULL if bundle does not exist, it is fine. 55 | } 56 | 57 | 58 | CFStringRef 59 | CreateDefaultExternBundleString(CFArrayRef inCommandName) 60 | { 61 | CFObj externBundleURL( CreateDefaultExternBundleURL(inCommandName) ); 62 | if(externBundleURL == NULL) 63 | return NULL; 64 | 65 | return ::CFURLCopyFileSystemPath(externBundleURL, kCFURLPOSIXPathStyle); 66 | } 67 | 68 | };//extern "C" 69 | -------------------------------------------------------------------------------- /AbracodeFramework/DefaultExternBundle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DefaultExternBundle.h 3 | * OMCApplet 4 | * 5 | * Created by Tomasz Kukielka on 9/8/06. 6 | * Copyright 2006 Abracode. All rights reserved. 7 | * 8 | */ 9 | #include 10 | 11 | extern "C" 12 | { 13 | CFURLRef CreateDefaultExternBundleURL(CFArrayRef inCommandName); 14 | CFStringRef CreateDefaultExternBundleString(CFArrayRef inCommandName); 15 | CFBundleRef CreateDefaultExternBundleRef(CFArrayRef inCommandName); 16 | 17 | }; //extern "C" -------------------------------------------------------------------------------- /AbracodeFramework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleName 10 | ${PRODUCT_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | ${PRODUCT_BUNDLE_IDENTIFIER} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${OMC_BUNDLE_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /AbracodeFramework/MoreAppleEvents/MoreAppleEvents.cp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/AbracodeFramework/MoreAppleEvents/MoreAppleEvents.cp -------------------------------------------------------------------------------- /AbracodeFramework/MoreAppleEvents/MoreAppleEvents.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/AbracodeFramework/MoreAppleEvents/MoreAppleEvents.h -------------------------------------------------------------------------------- /AbracodeFramework/NibDialogControl.h: -------------------------------------------------------------------------------- 1 | //************************************************************************************** 2 | // Filename: NibDialogControl.h 3 | // Part of Contextual Menu Workshop by Abracode Inc. 4 | // http://free.abracode.com/cmworkshop/ 5 | // Copyright � 2002-2004 Abracode, Inc. All rights reserved. 6 | // 7 | // 8 | //************************************************************************************** 9 | // Revision History: 10 | // July 21, 2004 - Original 11 | //************************************************************************************** 12 | 13 | #pragma once 14 | 15 | #include 16 | #include "CFObj.h" 17 | 18 | CFStringRef CreateControlIDFromString(CFStringRef inControlIDString, bool isEnvStyle); 19 | CFStringRef CreateTableIDAndColumnFromString(CFStringRef inTableIDAndColumnString, CFObj &outColumnIndexStr, bool useAllRows, bool isEnvStyle); 20 | 21 | CFStringRef CreateControlIDByStrippingModifiers(CFStringRef inControlIDWithModifiers, UInt32 &outModifiers); 22 | CFStringRef CreateControlIDByAddingModifiers(CFStringRef inControlID, UInt32 inModifiers); 23 | 24 | CFStringRef CreateWebViewIDAndElementIDFromString(CFStringRef inControlIDAndElementIDString, CFObj &outElementIDString, bool isEnvStyle); 25 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCCocoaDialog.h: -------------------------------------------------------------------------------- 1 | // 2 | // OMCCocoaDialog.h 3 | // Abracode 4 | // 5 | // Created by Tomasz Kukielka on 3/1/08. 6 | // Copyright 2008 Abracode. All rights reserved. 7 | // 8 | 9 | class OnMyCommandCM; 10 | #include "OMCDialog.h" 11 | 12 | using OMCDialogControllerRef = void *; 13 | 14 | class OMCCocoaDialog: public OMCDialog 15 | { 16 | public: 17 | OMCCocoaDialog(OMCDialogControllerRef inController) 18 | { 19 | mController = inController; 20 | } 21 | 22 | virtual ~OMCCocoaDialog() { } 23 | 24 | virtual CFTypeRef CopyControlValue(CFStringRef inControlID, CFStringRef inControlPart, SelectionIterator *inSelIterator, CFDictionaryRef *outCustomProperties) noexcept; 25 | virtual void CopyAllControlValues(CFSetRef requestedNibControls, SelectionIterator *inSelIterator) noexcept; 26 | 27 | virtual CFDataRef ReceivePortMessage( SInt32 msgid, CFDataRef inData );//remote message 28 | virtual void ReceiveNotification(void *ioData);//local message 29 | 30 | void SetController(OMCDialogControllerRef inController) noexcept 31 | { 32 | mController = inController; 33 | } 34 | 35 | private: 36 | void StoreControlValue(CFStringRef controlID, CFTypeRef inValue, CFStringRef controlPart) noexcept; 37 | 38 | private: 39 | OMCDialogControllerRef mController; //not owned 40 | }; 41 | 42 | 43 | ARefCountedObj RunCocoaDialog(OnMyCommandCM *inPlugin); 44 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCCocoaNib.h: -------------------------------------------------------------------------------- 1 | // 2 | // OMCCocoaNib.h 3 | // Abracode 4 | // 5 | // Created by Tomasz Kukielka on 1/17/08. 6 | // Copyright 2008 Abracode. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface OMCCocoaNib : NSObject 13 | { 14 | NSArray *mTopLevelNibObjects; 15 | } 16 | 17 | - (id)initWithNib:(NSNib *)inNib; 18 | - (id)initWithNibNamed:(NSString *)inNibName bundle:(NSBundle *)inBundle; 19 | 20 | - (NSWindow *)getFirstWindow; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCCocoaNib.m: -------------------------------------------------------------------------------- 1 | // 2 | // OMCCocoaNib.m 3 | // Abracode 4 | // 5 | // Created by Tomasz Kukielka on 1/17/08. 6 | // Copyright 2008 Abracode. All rights reserved. 7 | // 8 | 9 | #import "OMCCocoaNib.h" 10 | 11 | 12 | @implementation OMCCocoaNib 13 | 14 | - (id)initWithNib:(NSNib *)inNib 15 | { 16 | mTopLevelNibObjects = NULL; 17 | 18 | self = [super init]; 19 | if(self == nil) 20 | return nil; 21 | 22 | if( (inNib != nil) && [inNib instantiateWithOwner:self topLevelObjects:&mTopLevelNibObjects] ) 23 | { 24 | [mTopLevelNibObjects retain]; 25 | //NSLog(@"mTopLevelNibObjects=%@", mTopLevelNibObjects); 26 | } 27 | 28 | return self; 29 | } 30 | 31 | - (id)initWithNibNamed:(NSString *)inNibName bundle:(NSBundle *)inBundle 32 | { 33 | mTopLevelNibObjects = NULL; 34 | 35 | self = [super init]; 36 | if(self == nil) 37 | return nil; 38 | 39 | NSNib *myNib = [[NSNib alloc] initWithNibNamed:inNibName bundle:inBundle]; 40 | if(myNib != nil) 41 | { 42 | if ([myNib instantiateWithOwner:self topLevelObjects:&mTopLevelNibObjects]) 43 | { 44 | [mTopLevelNibObjects retain]; 45 | //NSLog(@"mTopLevelNibObjects=%@", mTopLevelNibObjects); 46 | } 47 | [myNib release]; 48 | } 49 | 50 | return self; 51 | } 52 | 53 | - (NSWindow *)getFirstWindow 54 | { 55 | if(mTopLevelNibObjects == NULL) 56 | return NULL; 57 | 58 | NSWindow *firstWindow = NULL; 59 | NSUInteger topObjectCount = [mTopLevelNibObjects count]; 60 | NSUInteger index = 0; 61 | for(index = 0; index < topObjectCount; index++) 62 | { 63 | id topObject = [mTopLevelNibObjects objectAtIndex:index]; 64 | if( (topObject != NULL) && [topObject isKindOfClass:[NSWindow class]] ) 65 | { 66 | firstWindow = (NSWindow *)topObject; 67 | break; 68 | } 69 | } 70 | 71 | #if _DEBUG_ 72 | 73 | for(index += 1; index < topObjectCount; index++) 74 | { 75 | id topObject = [mTopLevelNibObjects objectAtIndex:index]; 76 | if( (topObject != NULL) && [topObject isKindOfClass:[NSWindow class]] ) 77 | { 78 | NSLog(@"More than one window in the nib, only the first one can be used"); 79 | break; 80 | } 81 | } 82 | #endif //_DEBUG_ 83 | 84 | return firstWindow; 85 | } 86 | 87 | - (void)dealloc 88 | { 89 | [mTopLevelNibObjects release]; 90 | [super dealloc]; 91 | } 92 | 93 | 94 | @end 95 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCCommandExecutor.h: -------------------------------------------------------------------------------- 1 | // 2 | // OMCCommandExecutor.h 3 | // Abracode 4 | // 5 | // Created by Tomasz Kukielka on 4/6/08. 6 | // Copyright 2008 Abracode. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface OMCCommandExecutor : NSObject 13 | { 14 | } 15 | 16 | + (OSStatus)runCommand:(NSString *)inCommandNameOrId forCommandFile:(NSString *)inFileName withContext:(id)inContext useNavDialog:(BOOL)useNavDialog delegate:(id)delegate; 17 | + (CFPropertyListRef)cachedPlistForCommandFile:(NSString *)inFileName; 18 | + (CFPropertyListRef)cachedPlistForURL:(NSURL *)inURL; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCCommandMenu.h: -------------------------------------------------------------------------------- 1 | // 2 | // OMCCommandMenu.h 3 | // Abracode 4 | // 5 | // Created by Tomasz Kukielka on 4/6/08. 6 | // Copyright 2008 Abracode. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | IB_DESIGNABLE 12 | @interface OMCCommandMenu : NSMenu 13 | { 14 | NSString * _commandFilePath; 15 | } 16 | 17 | @property (nonatomic, retain) IBInspectable NSString * commandFilePath; 18 | 19 | - (void)executeCommand:(id)sender; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCConstants.h: -------------------------------------------------------------------------------- 1 | //#include "OMCConstants.h" 2 | 3 | #pragma once 4 | 5 | enum 6 | { 7 | kExecSilentPOpen, 8 | kExecSilentSystem, 9 | kExecTerminal, 10 | kExecITerm, 11 | kExecPOpenWithOutputWindow, 12 | kExecAppleScript, 13 | kExecAppleScriptWithOutputWindow, 14 | kExecPopenScriptFile, 15 | kExecPopenScriptFileWithOutputWindow 16 | }; 17 | 18 | 19 | enum 20 | { 21 | kEscapeModeFirst = 0, 22 | kEscapeNone = kEscapeModeFirst, 23 | kEscapeWithBackslash, 24 | kEscapeWithPercent, 25 | kEscapeWithPercentAll, 26 | kEscapeForAppleScript, 27 | kEscapeWrapWithSingleQuotesForShell, 28 | kEscapeModeLast = kEscapeWrapWithSingleQuotesForShell 29 | }; 30 | 31 | enum 32 | { 33 | kMulObjProcessSeparately, 34 | kMulObjProcessTogether 35 | }; 36 | 37 | enum 38 | { 39 | kSortMethodNone, 40 | kSortMethodByName 41 | }; 42 | 43 | enum 44 | { 45 | kInputClearText, 46 | kInputPasswordText, 47 | kInputPopupMenu, 48 | kInputComboBox 49 | }; 50 | 51 | enum 52 | { 53 | kMatchExact, 54 | kMatchContains, 55 | kMatchRegularExpression 56 | }; 57 | 58 | enum 59 | { 60 | kMatchFileName, 61 | kMatchFilePath 62 | }; 63 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCCustomWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // OMCCustomWindow.h 3 | // Abracode 4 | // 5 | // Created by Tomasz Kukielka on 5/24/08. 6 | // Copyright 2008 Abracode Inc. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | 12 | struct OutputWindowSettings; 13 | 14 | 15 | @interface OMCCustomWindow : NSWindow 16 | { 17 | BOOL useFadeIn; 18 | BOOL useFadeOut; 19 | 20 | NSViewAnimation *_fadeOutAnimation;//temporary object present at closing, not owned 21 | 22 | CGRect textBox;//top-left relative 23 | CGRect closeBox; //top-left relative 24 | CGRect resizeBox;//bottom-right relative 25 | 26 | NSPoint initialLocation; 27 | BOOL dragResizing; 28 | } 29 | 30 | -(id)initWithSettings:(const OutputWindowSettings *)inSettings; 31 | -(void)setFadeIn:(BOOL)inFadeIn; 32 | -(void)setFadeOut:(BOOL)inFadeOut; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCDropletController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OMCDropletController.h 3 | // CocoaApp 4 | // 5 | // Created by Tomasz Kukielka on 4/17/08. 6 | // 7 | 8 | #import 9 | 10 | IB_DESIGNABLE 11 | @interface OMCDropletController : NSDocumentController 12 | { 13 | NSString * _commandFilePath; 14 | BOOL _startingUp; 15 | CGEventFlags _startupModifiers; 16 | int _runningCommandCount; 17 | } 18 | 19 | @property (nonatomic, retain) IBInspectable NSString * commandID; // main/startup command name/id 20 | @property (nonatomic, retain) IBInspectable NSString * commandFilePath; //main plist file 21 | 22 | - (void)openFiles:(NSArray *)absoluteURLArray; 23 | 24 | - (void)handleGetURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCEnvironmentExportScript.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OMCEnvironmentExportScript.h 3 | */ 4 | 5 | #pragma once 6 | #include 7 | 8 | //if isSh = true use export 9 | //if isSh = false use setenv 10 | 11 | bool WriteEnvironmentSetupScriptToTmp(CFDictionaryRef inEnvironmentDict, CFStringRef inCommandGUID, bool isSh); 12 | CFStringRef CreateEnvironmentSetupCommandForShell(CFStringRef inCommandGUID, bool isSh); 13 | bool IsShDefaultInTerminal(); 14 | bool IsShDefaultInITem(); 15 | 16 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCFilePanels.h: -------------------------------------------------------------------------------- 1 | // 2 | // OMCFilePanels.h 3 | // Abracode 4 | // 5 | // Created by Tomasz Kukielka on 5/25/08. 6 | // Copyright 2008 Abracode Inc. All rights reserved. 7 | // 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif //__cplusplus 12 | 13 | enum 14 | { 15 | kOMCFilePanelAllowInvisibleItems = 0x01, 16 | kOMCFilePanelCanChooseFiles = 0x02, 17 | kOMCFilePanelCanChooseDirectories = 0x04, 18 | kOMCFilePanelAllowMultipleItems = 0x08, 19 | kOMCFilePanelUseCachedPath = 0x10 //subcommands may reuse the path already obtained by the main command or another subcommand 20 | }; 21 | 22 | CFURLRef CreateCFURLFromSaveAsDialog( CFStringRef inClientName, CFStringRef inMessage, CFStringRef inDefaultName, CFStringRef inDefaultDirPath, UInt32 inAdditonalFlags); 23 | CFURLRef CreateCFURLFromOpenDialog( CFStringRef inClientName, CFStringRef inMessage, CFStringRef inDefaultName, CFStringRef inDefaultDirPath, UInt32 inAdditonalFlags); 24 | CFArrayRef CreateCFURLsFromOpenDialog( CFStringRef inClientName, CFStringRef inMessage, CFStringRef inDefaultName, CFStringRef inDefaultDirPath, UInt32 inAdditonalFlags); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif //__cplusplus 29 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCHelpers.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | CFStringRef CopyHostAppName(); 9 | CFStringRef CopyFrontAppName(); 10 | CFStringRef CopyFrontAppBundleIdentifier(); 11 | pid_t GetFrontAppPID(); 12 | CFStringRef CopyAppNameForPID(pid_t pid); 13 | bool RunningInRegularGUIApp(); 14 | 15 | void RefreshFileInFinder(CFStringRef filePath); 16 | void GetOperatingSystemVersion(long* outMajorVersion, long* outMinorVersion, long* outPatchVersion); 17 | 18 | CGEventFlags GetKeyboardModifiers(); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCInputDialog.h: -------------------------------------------------------------------------------- 1 | // 2 | // OMCInputDialog.h 3 | // Abracode 4 | // 5 | // Created by Tomasz Kukielka on 8/25/09. 6 | // Copyright 2009-2010 Abracode. All rights reserved. 7 | // 8 | 9 | class OnMyCommandCM; 10 | 11 | //returns true if OKeyed and outStringRef is retained so caller responsible for releasing it 12 | Boolean RunCocoaInputDialog(OnMyCommandCM *inPlugin, CFStringRef &outStringRef); -------------------------------------------------------------------------------- /AbracodeFramework/OMCInputDialogController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OMCInputDialogController.h 3 | // Abracode 4 | // 5 | // Created by Tomasz Kukielka on 8/25/09. 6 | // Copyright 2009-2010 Abracode. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface OMCInputDialogController : NSWindowController 13 | { 14 | IBOutlet NSTextField *mMessageText; 15 | IBOutlet NSButton *mOKButton; 16 | IBOutlet NSButton *mCancelButton; 17 | 18 | //only one of those connected: 19 | IBOutlet NSTextField *mEditField; 20 | IBOutlet NSSecureTextField *mPasswordField; 21 | IBOutlet NSPopUpButton *mPopupButton; 22 | IBOutlet NSComboBox *mComboBox; 23 | BOOL mIsCanceled; 24 | NSArray *mMenuItems;//for popup or combo - may include mappings 25 | } 26 | 27 | //setup 28 | - (void)setMenuItems:(NSArray*)inMenuItems;//array of NAME & VALUE mappings 29 | - (void)setWindowTitle:(NSString*)inTitle; 30 | - (void)setMessageText:(NSString*)inText; 31 | - (void)setOKButtonTitle:(NSString *)inTitle; 32 | - (void)setCancelButtonTitle:(NSString *)inTitle; 33 | 34 | - (BOOL)runModalDialog; 35 | - (IBAction)closeWindow:(id)sender; 36 | 37 | - (void)layoutControls; 38 | 39 | - (NSString *)getChoiceString; 40 | - (void)setDefaultChoiceString:(NSString *)inString; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCMainMenuController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OMCMainMenuController.h 3 | // Abracode 4 | // 5 | // Created by Tomasz Kukielka on 3/30/08. 6 | // Copyright 2008 Abracode. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | IB_DESIGNABLE 12 | @interface OMCMainMenuController : NSObject 13 | { 14 | NSString * _commandFilePath; 15 | } 16 | 17 | @property (nonatomic, retain) IBInspectable NSString * commandFilePath; 18 | 19 | - (void)connectOMCMenuItems:(NSMenu *)inMenu; 20 | - (void)executeCommand:(id)sender; 21 | 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCMainMenuController.m: -------------------------------------------------------------------------------- 1 | // 2 | // OMCMainMenuController.m 3 | // Abracode 4 | // 5 | // Created by Tomasz Kukielka on 3/30/08. 6 | // Copyright 2008 Abracode. All rights reserved. 7 | // 8 | 9 | #import "OMCMainMenuController.h" 10 | #import "OMCMenuItem.h" 11 | #import "OMCCommandExecutor.h" 12 | 13 | @implementation OMCMainMenuController 14 | 15 | @synthesize commandFilePath = _commandFilePath; 16 | 17 | - (id)init 18 | { 19 | self = [super init]; 20 | if(self == nil) 21 | return nil; 22 | 23 | self.commandFilePath = @"Command.plist"; 24 | 25 | return self; 26 | } 27 | 28 | - (void)dealloc 29 | { 30 | self.commandFilePath = nil; 31 | [super dealloc]; 32 | } 33 | 34 | - (void)awakeFromNib 35 | { 36 | NSApplication *myApp = [NSApplication sharedApplication]; 37 | if(myApp == NULL) 38 | return; 39 | 40 | NSMenu *myMenu = [myApp mainMenu]; 41 | 42 | if(myMenu == NULL) 43 | return; 44 | 45 | [self connectOMCMenuItems:myMenu]; 46 | 47 | } 48 | 49 | - (void)setCommandFilePath:(NSString *)inPath 50 | { 51 | if((inPath != nil) && ([inPath length] > 0)) 52 | { 53 | [inPath retain]; 54 | [_commandFilePath release]; 55 | _commandFilePath = inPath; 56 | } 57 | else 58 | { 59 | [_commandFilePath release]; 60 | _commandFilePath = [@"Command.plist" retain]; 61 | } 62 | } 63 | 64 | 65 | - (void) connectOMCMenuItems:(NSMenu *)inMenu 66 | { 67 | NSInteger i; 68 | NSInteger itemCount = [inMenu numberOfItems]; 69 | for(i = 0; i < itemCount; i++) 70 | { 71 | NSMenuItem *oneItem = [inMenu itemAtIndex:i]; 72 | if(oneItem != NULL) 73 | { 74 | if( [oneItem isKindOfClass:[OMCMenuItem class]] ) 75 | { 76 | if( [oneItem target] == NULL )//don't override targets preset in IB 77 | { 78 | [oneItem setTarget:self]; 79 | [oneItem setAction:@selector(executeCommand:)]; 80 | } 81 | } 82 | 83 | if( [oneItem hasSubmenu] ) 84 | { 85 | [self connectOMCMenuItems:[oneItem submenu]]; 86 | } 87 | } 88 | } 89 | } 90 | 91 | - (void)executeCommand:(id)sender 92 | { 93 | if( (sender == NULL) || ![sender respondsToSelector:@selector(commandID)] ) 94 | return; 95 | 96 | NSString *myCommandID = [sender commandID]; 97 | 98 | /*OSStatus err = */[OMCCommandExecutor runCommand:myCommandID forCommandFile:self.commandFilePath withContext:NULL useNavDialog:YES delegate:self]; 99 | } 100 | 101 | @end //OMCMainMenuController 102 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCObserver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OMCObserver.h 3 | * Abracode 4 | * 5 | * Created by Tomasz Kukielka on 1/3/08. 6 | * Copyright 2008 Abracode. All rights reserved. 7 | * 8 | */ 9 | #include "AObserver.h" 10 | #include "OMC.h" 11 | 12 | class OMCObserver : public ARefCounted 13 | { 14 | public: 15 | 16 | OMCObserver(UInt32 messageTypes, OMCObserverCallback inCallback, void *userData) 17 | : mMessageTypes( messageTypes ), 18 | mTaskObserver( new AObserver(this) ), 19 | mCallback( inCallback ), 20 | mUserData( userData ) 21 | { 22 | } 23 | 24 | virtual ~OMCObserver(void) 25 | { 26 | if(mTaskObserver!= NULL) 27 | mTaskObserver->SetOwner(NULL);//observer may outlive us so it is very important to tell that we died 28 | } 29 | 30 | void ReceiveNotification(void *ioData); 31 | 32 | AObserverBase * GetObserver() 33 | { 34 | return (AObserver *)mTaskObserver; 35 | } 36 | 37 | void DetachFromAllNotifiers() 38 | { 39 | if(mTaskObserver!= NULL) 40 | mTaskObserver->DetachFromAllNotifiers(); 41 | } 42 | 43 | void Unregister() 44 | { 45 | mMessageTypes = kOmcObserverMessageNone; 46 | mCallback = NULL; 47 | mUserData = NULL; 48 | } 49 | 50 | private: 51 | UInt32 mMessageTypes; 52 | ARefCountedObj< AObserver > mTaskObserver; 53 | OMCObserverCallback mCallback; 54 | void * mUserData; 55 | }; 56 | 57 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCOutputWindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OMCOutputWindowController.h 3 | // Abracode 4 | // 5 | // Created by Tomasz Kukielka on 5/14/08. 6 | // Copyright 2008 Abracode Inc. All rights reserved. 7 | // 8 | 9 | class OutputWindowHandler; 10 | struct OutputWindowSettings; 11 | 12 | #ifdef __OBJC__ 13 | 14 | #import 15 | 16 | @interface OMCOutputWindowController : NSWindowController 17 | { 18 | IBOutlet NSTextView* textView; 19 | OutputWindowHandler * mHandler;//to delete when window closed 20 | } 21 | 22 | - (void)setup: (const OutputWindowSettings *)inSettings withHandler:(OutputWindowHandler *)inHandler; 23 | - (void)setWindowPosition:(NSWindow *)inWindow withSettings: (const OutputWindowSettings *)inSettings; 24 | - (void)setText:(NSString *)inText; 25 | - (void)appendText:(NSString *)inText; 26 | 27 | @end 28 | 29 | #endif //__OBJC__ 30 | 31 | typedef void *OMCOutputWindowControllerRef; 32 | 33 | OMCOutputWindowControllerRef CreateOutputWindowController(const OutputWindowSettings &inSettings, OutputWindowHandler *inHandler); 34 | void ReleaseOutputWindowController(OMCOutputWindowControllerRef inControllerRef); 35 | void OMCOutputWindowSetText(OMCOutputWindowControllerRef inControllerRef, CFStringRef inText); 36 | void OMCOutputWindowAppendText(OMCOutputWindowControllerRef inControllerRef, CFStringRef inText); 37 | void OMCOutputWindowScheduleClosing(OMCOutputWindowControllerRef inControllerRef, CFTimeInterval delay); 38 | void ResetOutputWindowCascading(); 39 | 40 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCPanel.h: -------------------------------------------------------------------------------- 1 | // 2 | // OMCPanel.h 3 | // Abracode 4 | // 5 | // Created by Tomasz Kukielka on 5/25/08. 6 | // Copyright 2008 Abracode Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface OMCPanel : NSPanel 13 | { 14 | BOOL useFadeIn; 15 | BOOL useFadeOut; 16 | 17 | NSViewAnimation *_fadeOutAnimation;//temporary object present at closing, not owned 18 | } 19 | 20 | -(void)setFadeIn:(BOOL)inFadeIn; 21 | -(void)setFadeOut:(BOOL)inFadeOut; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCProgressWindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OMCProgressWindowController.h 3 | // Abracode 4 | // 5 | // Created by Tomasz Kukielka on 10/31/08. 6 | // Copyright 2008 Abracode Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface OMCProgressWindowController : NSWindowController 12 | { 13 | IBOutlet NSProgressIndicator *mProgressIndicator; 14 | IBOutlet NSTextField *mStatusText; 15 | BOOL mCanceled; 16 | BOOL mIsDeterminate; 17 | int mLastValue; 18 | NSString *mLastString; 19 | } 20 | 21 | - (void)setProgress:(double)inProgress text:(NSString *)inText; 22 | - (IBAction)closeWindow:(id)sender; 23 | - (BOOL)isCanceled; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCScriptsManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OMCScriptsManager.h 3 | */ 4 | 5 | #pragma once 6 | 7 | #ifdef __cplusplus 8 | 9 | #include "CFObj.h" 10 | 11 | class OMCScriptsManager 12 | { 13 | public: 14 | 15 | static OMCScriptsManager* GetScriptsManager(); 16 | 17 | OMCScriptsManager(); 18 | ~OMCScriptsManager() { } 19 | 20 | CFStringRef GetScriptPath(CFBundleRef inBundle, CFStringRef inScriptName); 21 | 22 | private: 23 | CFMutableDictionaryRef CreateScriptsCacheForBundle(CFBundleRef inBundle); 24 | 25 | private: 26 | CFObj mBundles; //key:bundle, value:dict of name/path pairs 27 | }; 28 | 29 | #endif //__cplusplus 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | CFStringRef OMCGetScriptPath(CFBundleRef inBundle, CFStringRef inScriptName); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCService.h: -------------------------------------------------------------------------------- 1 | // 2 | // OMCService.h 3 | // OMCService 4 | // 5 | // Created by Tomasz Kukielka on 1/20/11. 6 | // Copyright 2011 Abracode. All rights reserved. 7 | // 8 | 9 | #import 10 | #include "OMC.h" 11 | 12 | 13 | //responds to applicationDidFinishLaunching: but in case of OMC droplet it is not the app delegate - OMCDropletController is and forwards applicationDidFinishLaunching: 14 | //in case of standalone service OMCService is an app controller and receives the applicationDidFinishLaunching: directly 15 | @interface OMCService : NSObject 16 | { 17 | OMCObserverRef mObserver; 18 | NSMutableString *mResultString; 19 | BOOL mRunLoopStarted; 20 | } 21 | 22 | - (void)runOMCService:(NSPasteboard *)pboard userData:(NSString *)userData error:(NSString **)error; 23 | - (void)receiveObserverMessage:(OmcObserverMessage)inMessage forTaskId:(CFIndex)inTaskID withData:(CFTypeRef)inResult; 24 | 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCSingleCommand.h: -------------------------------------------------------------------------------- 1 | // 2 | // OMCSingleCommand.h 3 | // Abracode 4 | // 5 | // Created by Tomasz Kukielka on 4/5/08. 6 | // Copyright 2008 Abracode. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | IB_DESIGNABLE 12 | @interface OMCSingleCommand : NSObject 13 | { 14 | NSString * _commandFilePath; 15 | } 16 | 17 | @property (nonatomic, retain) IBInspectable NSString * commandID; 18 | @property (nonatomic, retain) IBInspectable NSString * commandFilePath; 19 | 20 | - (void)execute:(id)sender; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCSingleCommand.m: -------------------------------------------------------------------------------- 1 | // 2 | // OMCSingleCommand.m 3 | // Abracode 4 | // 5 | // Created by Tomasz Kukielka on 4/5/08. 6 | // Copyright 2008 Abracode. All rights reserved. 7 | // 8 | 9 | #import "OMCSingleCommand.h" 10 | #import "OMCCommandExecutor.h" 11 | 12 | @implementation OMCSingleCommand 13 | 14 | @synthesize commandFilePath = _commandFilePath; 15 | 16 | - (id)init 17 | { 18 | self = [super init]; 19 | if(self == nil) 20 | return nil; 21 | 22 | self.commandFilePath = @"Command.plist"; 23 | 24 | return self; 25 | } 26 | 27 | - (id)initWithCoder:(NSCoder *)coder 28 | { 29 | self = [super init]; 30 | if(self == nil) 31 | return nil; 32 | self.commandFilePath = @"Command.plist"; 33 | 34 | return self; 35 | } 36 | 37 | - (void)encodeWithCoder:(nonnull NSCoder *)coder { 38 | } 39 | 40 | 41 | 42 | - (void)dealloc 43 | { 44 | self.commandID = nil; 45 | self.commandFilePath = nil; 46 | [super dealloc]; 47 | } 48 | 49 | - (void)setCommandFilePath:(NSString *)inPath 50 | { 51 | if((inPath != nil) && ([inPath length] > 0)) 52 | { 53 | [inPath retain]; 54 | [_commandFilePath release]; 55 | _commandFilePath = inPath; 56 | } 57 | else 58 | { 59 | [_commandFilePath release]; 60 | _commandFilePath = [@"Command.plist" retain]; 61 | } 62 | } 63 | 64 | - (void)execute:(id)sender 65 | { 66 | NSString *myCommandID = self.commandID; 67 | if( (sender != NULL) && [sender respondsToSelector:@selector(commandID)] ) 68 | { 69 | myCommandID = [sender commandID]; 70 | } 71 | 72 | /*OSStatus err = */[OMCCommandExecutor runCommand:myCommandID forCommandFile:self.commandFilePath withContext:NULL useNavDialog:YES delegate:self]; 73 | } 74 | 75 | 76 | @end 77 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCStrings.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | CFStringRef CreatePathByExpandingTilde(CFStringRef inPath); 9 | CFStringRef CopyFilenameExtension(CFStringRef inFilePath); 10 | 11 | CFStringRef CreateLowercaseString(CFStringRef inStr); 12 | 13 | UInt32 StringToVersion(CFStringRef inString); 14 | CFStringRef CreateVersionString(UInt32 inVersion); 15 | 16 | CFStringRef CreateStringByAddingPercentEscapes(CFStringRef inStr, bool escapeAll); 17 | void ReplaceWhitespaceEscapesWithCharacters(CFMutableStringRef ioStrRef); 18 | void ReplaceWhitespaceCharactersWithEscapes(CFMutableStringRef ioStrRef); 19 | 20 | CFStringRef CreateEscapedStringCopy(CFStringRef inStrRef, UInt16 escSpecialCharsMode); 21 | 22 | bool WriteStringToFile(CFStringRef inContentStr, CFStringRef inFilePath); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // OMCTableViewController.h 3 | // Abracode 4 | // 5 | // Created by Tomasz Kukielka on 9/13/09. 6 | // Copyright 2009-2010 Abracode. All rights reserved. 7 | // 8 | 9 | #import 10 | #include "SelectionIterator.h" 11 | 12 | typedef enum ColumnSeparatorFormat 13 | { 14 | kOMCColumnSeparatorTab, 15 | kOMCColumnSeparatorComma, 16 | kOMCColumnSeparatorSpace 17 | } ColumnSeparatorFormat; 18 | 19 | @class OMCDialogController; 20 | 21 | @interface OMCTableViewController : NSObject 22 | { 23 | NSTableView *mTableView;//the table we control 24 | OMCDialogController *mDialogController;//the dialog controller that owns us 25 | NSMutableArray *mRows; 26 | NSArray *mColumnNames; 27 | NSArray *mColumnWidths; 28 | NSString *mSelectionChangeCommandID; 29 | ColumnSeparatorFormat mSeparator; 30 | } 31 | 32 | - (id)initWithTableView:(NSTableView *)aTableView dialogController:(OMCDialogController *)inController; 33 | 34 | -(void)removeRows; 35 | -(void)addRows:(CFArrayRef)inRowArray; 36 | -(void)reloadData; 37 | -(void)setColumns:(CFArrayRef)inColumnArray; 38 | -(void)setColumnWidths:(CFArrayRef)inWidthsArray; 39 | -(NSArray *)splitRowString:(NSString *)inRowString; 40 | -(NSArray *)columnArrayForRow:(NSUInteger)inRowIndex; 41 | -(id)selectionValueForColumn:(NSInteger)inColumnIndex withIterator:(SelectionIterator *)inSelIterator; 42 | -(NSArray *)allRowsForColumn:(NSInteger)inColumnIndex; 43 | -(NSString *)stringForRow:(NSUInteger)inRow column:(NSUInteger)inColumn prefix:(NSString *)colPrefix suffix:(NSString *)colSuffix separator:(NSString *)colSeparator; 44 | -(NSUInteger)columnCount; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCTerminalExecutor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OMCTerminalExecutor.h 3 | * OnMyCommandCM 4 | */ 5 | 6 | void ExecuteInTerminal(CFStringRef inCommand, bool openInNewWindow, bool bringToFront); 7 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // OMCWindow.h 3 | // Abracode 4 | // 5 | // Created by Tomasz Kukielka on 5/24/08. 6 | // Copyright 2008 Abracode Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface OMCWindow : NSWindow 13 | { 14 | BOOL useFadeIn; 15 | BOOL useFadeOut; 16 | 17 | NSViewAnimation *_fadeOutAnimation;//temporary object present at closing, not owned 18 | } 19 | 20 | -(void)setFadeIn:(BOOL)inFadeIn; 21 | -(void)setFadeOut:(BOOL)inFadeOut; 22 | 23 | +(void)addWindow; 24 | +(void)removeWindow; 25 | +(int)getWindowCount; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /AbracodeFramework/OMCiTermExecutor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OMCTerminalExecutor.h 3 | * OnMyCommandCM 4 | */ 5 | 6 | void ExecuteInITerm(CFStringRef inCommand, CFStringRef inShellPath, bool openInNewWindow, bool bringToFront); 7 | -------------------------------------------------------------------------------- /AbracodeFramework/OmcTaskNotification.h: -------------------------------------------------------------------------------- 1 | /* 2 | * OmcTaskNotification.h 3 | * OnMyCommandCM 4 | * 5 | * Created by Tomasz Kukielka on Fri Dec 1 2006. 6 | * Copyright (c) 2006 Abracode, Inc. All rights reserved. 7 | * 8 | * Defines protocol used by Omc task notifications 9 | * 10 | */ 11 | 12 | 13 | typedef enum OmcTaskMessageID 14 | { 15 | kOmcTaskNone, 16 | kOmcTaskFinished, //tasks notifies its observers that it ended, data is NULL 17 | kOmcTaskProgress, //task notifies its observes about progress and may provide data for observer to process 18 | kOmcTaskCancel, //cancel message can be sent to task or to task manager 19 | kOmcAllTasksFinished //sent by task manager only. data is NULL 20 | } OmcTaskMessageID; 21 | 22 | typedef enum OmcTaskDataType 23 | { 24 | kOMCDataTypeNone = 0, 25 | kOmcDataTypePointer, 26 | kOmcDataTypeCFString, 27 | kOmcDataTypeCFData, 28 | kOmcDataTypeCFIndex, 29 | kOmcDataTypeBoolean 30 | } OmcTaskDataType; 31 | 32 | typedef struct OmcTaskData 33 | { 34 | OmcTaskMessageID messageID; 35 | CFIndex taskID; 36 | pid_t childProcessID; 37 | OSStatus error; 38 | OmcTaskDataType dataType; 39 | size_t dataSize; 40 | union 41 | { 42 | const void * ptr; 43 | CFTypeRef cfObj; 44 | CFIndex index; 45 | Boolean test; 46 | } data; 47 | } OmcTaskData; 48 | 49 | CFDataRef OMCTaskCreatePackedData( const OmcTaskData &iStruct ); 50 | bool OMCTaskUnpackData( CFDataRef inData, OmcTaskData &outStruct ); 51 | -------------------------------------------------------------------------------- /AbracodeFramework/Resources/OMCWebKitSupport.js: -------------------------------------------------------------------------------- 1 | class OMC 2 | { 3 | //get values of all elements whose class id = "OMC" 4 | static getAllElementValues() 5 | { 6 | let valuesDict = {}; 7 | let elemsArray = document.getElementsByClassName("OMC"); 8 | for (let i = 0, len = elemsArray.length; i < len; i++) 9 | { 10 | let elem = elemsArray[i]; 11 | if(elem.hasAttribute('id')) 12 | { 13 | //console.log("id = " + elem.id); 14 | if(elem.nodeName == "INPUT") 15 | { 16 | //console.log("value = " + elem.value); 17 | 18 | if((elem.type == "checkbox") || (elem.type == "radio")) 19 | { 20 | if(elem.checked) 21 | valuesDict[elem.id] = elem.value; 22 | else 23 | valuesDict[elem.id] = ""; 24 | } 25 | else 26 | { 27 | valuesDict[elem.id] = elem.value; 28 | } 29 | } 30 | else 31 | { 32 | //console.log("innerHTML = " + elem.innerHTML); 33 | //valuesDict[elem.id] = elem.innerHTML; 34 | valuesDict[elem.id] = elem.innerText; 35 | } 36 | } 37 | } 38 | return valuesDict; 39 | } 40 | 41 | //get all IDs of elements whose class id = "OMC" 42 | static getAllElementIDs() 43 | { 44 | var elementIDs = []; 45 | let elemsArray = document.getElementsByClassName("OMC"); 46 | for (let i = 0, len = elemsArray.length; i < len; i++) 47 | { 48 | let elem = elemsArray[i]; 49 | if(elem.hasAttribute('id')) 50 | { 51 | elementIDs.push(elem.id); 52 | } 53 | } 54 | return elementIDs; 55 | } 56 | 57 | //find element by id and add "OMC" class 58 | static registerElementByID(elementID) 59 | { 60 | let foundElement = document.getElementById(elementID); 61 | if(foundElement !== null) 62 | { 63 | foundElement.classList.add("OMC"); 64 | } 65 | } 66 | 67 | //for given element assign a new id and add "OMC" class 68 | static registerElement(element, newID) 69 | { 70 | if(element !== undefined) 71 | { 72 | element.id = newID; 73 | element.classList.add("OMC"); 74 | } 75 | } 76 | 77 | //execute command with given ID on native code side 78 | static execute(commandID, senderElementID) 79 | { 80 | let messageDict = {}; 81 | if(commandID !== undefined) 82 | { 83 | messageDict["commandID"] = commandID; 84 | 85 | if (senderElementID !== undefined) 86 | { 87 | messageDict["elementID"] = senderElementID; 88 | } 89 | 90 | window.webkit.messageHandlers.OMC.postMessage(messageDict); 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /AbracodeFramework/Resources/app.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/AbracodeFramework/Resources/app.icns -------------------------------------------------------------------------------- /AbracodeFramework/Resources/stop.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/AbracodeFramework/Resources/stop.icns -------------------------------------------------------------------------------- /AbracodeFramework/SelectionIterator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SelectionIterator.h 3 | * Abracode 4 | * 5 | * Created by Tomasz Kukielka on 10/1/09. 6 | * Copyright 2009-2010 Abracode. All rights reserved. 7 | * 8 | */ 9 | 10 | #ifndef _SelectionIterator_h_ 11 | #define _SelectionIterator_h_ 12 | 13 | //new iterator starts at first valid item. Calling Next() will move to next selection 14 | typedef struct SelectionIterator 15 | { 16 | unsigned long *mSelectedRows; 17 | unsigned long mSelCount; //the number of items in mSelectedRows 18 | unsigned long mCurrSelIndex;//index into mSelectedRows 19 | } SelectionIterator; 20 | 21 | //inSelRows must be allocated with malloc. we take ownership of it here and will release with iterator 22 | static inline SelectionIterator *SelectionIterator_Create(unsigned long *inSelRows, size_t inCount) 23 | { 24 | SelectionIterator *outIterator = (SelectionIterator *)calloc(1, sizeof(SelectionIterator)); 25 | outIterator->mSelectedRows = inSelRows; 26 | outIterator->mSelCount = inCount; 27 | return outIterator; 28 | } 29 | 30 | static inline SelectionIterator * AllRowsIterator_Create() 31 | { 32 | SelectionIterator *outIterator = (SelectionIterator *)calloc(1, sizeof(SelectionIterator)); 33 | outIterator->mSelectedRows = NULL; 34 | outIterator->mSelCount = (unsigned long)-1; 35 | outIterator->mCurrSelIndex = (unsigned long)-1; 36 | return outIterator; 37 | } 38 | 39 | static inline void SelectionIterator_Release(SelectionIterator *inIterator) 40 | { 41 | if(inIterator != NULL) 42 | { 43 | if( inIterator->mSelectedRows != NULL ) 44 | free(inIterator->mSelectedRows); 45 | free(inIterator); 46 | } 47 | } 48 | 49 | static inline Boolean SelectionIterator_IsValid(SelectionIterator *inIterator) 50 | { 51 | return ((inIterator->mSelectedRows != NULL) && (inIterator->mCurrSelIndex < inIterator->mSelCount)); 52 | } 53 | 54 | static inline Boolean SelectionIterator_IsAllRows(SelectionIterator *inIterator) 55 | { 56 | return ((inIterator->mSelectedRows == NULL) && (inIterator->mCurrSelIndex == (unsigned long)-1) && (inIterator->mCurrSelIndex == (unsigned long)-1) ); 57 | } 58 | 59 | static inline Boolean SelectionIterator_Next(SelectionIterator *inIterator) 60 | { 61 | inIterator->mCurrSelIndex++; 62 | return SelectionIterator_IsValid(inIterator); 63 | } 64 | 65 | //no bounds check here, caller must make sure the iterator is valid 66 | static inline unsigned long SelectionIterator_GetCurrentSelection(SelectionIterator *inIterator) 67 | { 68 | return inIterator->mSelectedRows[inIterator->mCurrSelIndex]; 69 | } 70 | 71 | #endif //_SelectionIterator_h_ 72 | -------------------------------------------------------------------------------- /AbracodeFramework/de.lproj/Private.strings: -------------------------------------------------------------------------------- 1 | /* Version warning strings */ 2 | "Cancel" = "Abbrechen"; 3 | "Try Anyway" = "Trotzdem probieren"; 4 | "TOO_LOW_OMC" = "Dieses Kommando benötigt mindestens OnMyCommand %@. Die installierte Version ist %@."; 5 | "TOO_LOW_MAC_OS" = "Dieses Kommando benötigt mindestens Mac OS %@. Es läuft Mac OS X Version %@."; 6 | "TOO_HIGH_MAC_OS" = "Dieses Kommando wurde für ältere Mac OS X Versionen entworfen, es funktioniert bis Version %@. Es läuft Mac OS X Version %@."; 7 | 8 | /* Default submenu */ 9 | "/On My Command" = "/On My Command"; 10 | 11 | /* Warning Dialog default button */ 12 | "Execute" = "Execute"; 13 | 14 | /*Alert strings*/ 15 | "OK" = "OK"; 16 | "CARBON_NIB_64_BIT" = "This command uses a legacy Carbon nib dialog. Carbon nibs are no longer supported."; 17 | -------------------------------------------------------------------------------- /AbracodeFramework/en.lproj/Private.strings: -------------------------------------------------------------------------------- 1 | /* Version warning strings */ 2 | "Cancel" = "Cancel"; 3 | "Try Anyway" = "Try Anyway"; 4 | "TOO_LOW_OMC" = "This command requires OnMyCommand %@ or higher. Your installed version is %@."; 5 | "TOO_LOW_MAC_OS" = "This command requires Mac OS %@ or higher. Your Mac OS X version is %@."; 6 | "TOO_HIGH_MAC_OS" = "This command is designed for older Mac OS X. It works up to version %@. Your Mac OS X version is %@."; 7 | 8 | /* Default submenu */ 9 | "/On My Command" = "/On My Command"; 10 | 11 | /* Warning Dialog default button */ 12 | "Execute" = "Execute"; 13 | 14 | /*Alert strings*/ 15 | "OK" = "OK"; 16 | "CARBON_NIB_64_BIT" = "This command uses a legacy Carbon nib dialog. Carbon nibs are no longer supported."; 17 | -------------------------------------------------------------------------------- /AbracodeFramework/fr.lproj/Private.strings: -------------------------------------------------------------------------------- 1 | /* Version warning strings */ 2 | "Cancel" = "Cancel"; 3 | "Try Anyway" = "Try Anyway"; 4 | "TOO_LOW_OMC" = "This command requires OnMyCommand %@ or higher. Your installed version is %@."; 5 | "TOO_LOW_MAC_OS" = "This command requires Mac OS %@ or higher. Your Mac OS X version is %@."; 6 | "TOO_HIGH_MAC_OS" = "This command is designed for older Mac OS X. It works up to version %@. Your Mac OS X version is %@."; 7 | 8 | /* Default submenu */ 9 | "/On My Command" = "/On My Command"; 10 | 11 | /* Warning Dialog default button */ 12 | "Execute" = "Execute"; 13 | 14 | /*Alert strings*/ 15 | "OK" = "OK"; 16 | "CARBON_NIB_64_BIT" = "This command uses a legacy Carbon nib dialog. Carbon nibs are no longer supported."; 17 | -------------------------------------------------------------------------------- /AbracodeFramework/ja.lproj/Private.strings: -------------------------------------------------------------------------------- 1 | /* Version warning strings */ 2 | "Cancel" = "キャンセル"; 3 | "Try Anyway" = "とにかく実行してみる"; 4 | "TOO_LOW_OMC" = "このコマンドは OnMyCommand %@ 以上を必要とします。インストールされているバージョンは、%@ です。"; 5 | "TOO_LOW_MAC_OS" = "このコマンドは Mac OS %@ を以上を必要とします。この Mac OS X はバージョン %@ です。"; 6 | "TOO_HIGH_MAC_OS" = "このコマンドは古い Mac OS X 用です。バージョン %@ まで動作します。この Mac OS X はバージョン %@ です。"; 7 | 8 | /* Default submenu */ 9 | "/On My Command" = "/On My Command"; 10 | 11 | /* Warning Dialog default button */ 12 | "Execute" = "Execute"; 13 | 14 | /*Alert strings*/ 15 | "OK" = "OK"; 16 | "CARBON_NIB_64_BIT" = "This command uses a legacy Carbon nib dialog. Carbon nibs are no longer supported."; 17 | -------------------------------------------------------------------------------- /AbracodeFramework/omc_popen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * omc_popen.h 3 | * 4 | * 5 | * Created by Tomasz Kukielka on 5/30/07. 6 | * Copyright 2007 Abracode. All rights reserved. 7 | * 8 | */ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | typedef struct ChildProcessInfo 15 | { 16 | int inputFD; 17 | int outputFD; 18 | pid_t pid; 19 | } ChildProcessInfo; 20 | 21 | typedef enum OMCPopenExecutionMode 22 | { 23 | kOMCPopenRead = 0x01, 24 | kOMCPopenWrite = 0x02, 25 | } OMCPopenExecutionMode; 26 | 27 | char ** CreateEnviron(char* const* inKeys, char* const* inValues, size_t inCount); 28 | void ReleaseEnviron(char **inEnviron); 29 | 30 | //returns 0 if succeeded 31 | //inEnvironList is terminated with entry where key=NULL 32 | //inShell is a string list terminated with NULL 33 | int omc_popen(const char *command, char * const *inShell, char * const *inEnvironList, unsigned int inMode, ChildProcessInfo *outChildProcessInfo); 34 | int omc_pclose(pid_t inChildPid); 35 | void omc_pclose_write(pid_t inChildPid); 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | -------------------------------------------------------------------------------- /Common/ACFArr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "CFObj.h" 4 | #include "ACFType.h" 5 | 6 | //T typename = CFArrayRef | CFMutableArrayRef 7 | template class ACFArrayBase : public CFObj 8 | { 9 | public: 10 | //note: reverse retain default than CFObj! 11 | ACFArrayBase( T inObj, CFObjRetainType inRetainType = kCFObjRetain ) noexcept 12 | : CFObj(inObj, inRetainType) 13 | { 14 | 15 | } 16 | 17 | CFIndex GetCount() const noexcept 18 | { 19 | if(this->mRef != NULL) 20 | return ::CFArrayGetCount( this->mRef ); 21 | return 0; 22 | } 23 | 24 | template< typename CFT > 25 | Boolean GetValueAtIndex( CFIndex idx, CFT &outValue ) const noexcept 26 | { 27 | if(this->mRef != NULL) 28 | { 29 | CFTypeRef resultRef = ::CFArrayGetValueAtIndex( this->mRef, idx ); 30 | return ACFType::DynamicCast(resultRef, outValue); 31 | } 32 | return false; 33 | } 34 | 35 | template< typename CFT > 36 | Boolean CopyValueAtIndex( CFIndex idx, CFT &outValue ) const noexcept 37 | { 38 | if( GetValueAtIndex(idx, outValue) ) 39 | { 40 | ::CFRetain(outValue); 41 | return true; 42 | } 43 | return false; 44 | } 45 | 46 | CFTypeRef GetValueAtIndex( CFIndex idx ) const noexcept 47 | { 48 | if(this->mRef != NULL) 49 | return ::CFArrayGetValueAtIndex( this->mRef, idx ); 50 | return NULL; 51 | } 52 | }; 53 | 54 | typedef ACFArrayBase ACFArr; 55 | 56 | class ACFMutableArr : public ACFArrayBase 57 | { 58 | public: 59 | ACFMutableArr(CFIndex maxCount = 0) noexcept 60 | : ACFArrayBase( ::CFArrayCreateMutable( kCFAllocatorDefault, maxCount, &kCFTypeArrayCallBacks ) ) 61 | { 62 | } 63 | 64 | //note: reverse retain default than CFObj! 65 | ACFMutableArr( CFMutableArrayRef inObj, CFObjRetainType inRetainType = kCFObjRetain ) noexcept 66 | : ACFArrayBase( inObj, inRetainType ) 67 | { 68 | } 69 | 70 | template< typename CFT > 71 | void InsertValueAtIndex( CFIndex idx, CFT inCFObj ) noexcept 72 | { 73 | ::CFArrayInsertValueAtIndex( mRef, idx, (const void *)inCFObj ); 74 | } 75 | 76 | template< typename CFT > 77 | void SetValueAtIndex( CFIndex idx, CFT inCFObj ) noexcept 78 | { 79 | ::CFArraySetValueAtIndex( mRef, idx, (const void *)inCFObj ); 80 | } 81 | 82 | template< typename CFT > 83 | void AppendValue( CFT inCFObj ) noexcept 84 | { 85 | ::CFArrayAppendValue( mRef, (const void *)inCFObj ); 86 | } 87 | 88 | void RemoveValueAtIndex( CFIndex idx ) noexcept 89 | { 90 | ::CFArrayRemoveValueAtIndex( mRef, idx ); 91 | } 92 | 93 | void RemoveAllValues() noexcept 94 | { 95 | ::CFArrayRemoveAllValues( mRef ); 96 | } 97 | }; 98 | 99 | -------------------------------------------------------------------------------- /Common/ACFPropertyList.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | CFPropertyListRef CreatePropertyList(CFURLRef plistURL, CFPropertyListMutabilityOptions mutabilityOptions); 9 | bool WritePropertyList(CFPropertyListRef propertyList, CFURLRef plistURL, CFPropertyListFormat plistFormat); 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | 15 | 16 | -------------------------------------------------------------------------------- /Common/ACFPropertyList.m: -------------------------------------------------------------------------------- 1 | #include "ACFPropertyList.h" 2 | #import 3 | 4 | CFPropertyListRef CreatePropertyList(CFURLRef plistURL, CFPropertyListMutabilityOptions mutabilityOptions) 5 | { 6 | CFPropertyListRef thePlist = NULL; 7 | 8 | @autoreleasepool 9 | { 10 | NSData* plistData = [NSData dataWithContentsOfURL:(NSURL *)plistURL]; 11 | if(plistData != NULL) 12 | thePlist = CFPropertyListCreateWithData(kCFAllocatorDefault, (CFDataRef)plistData, mutabilityOptions, NULL, NULL); 13 | } 14 | 15 | return thePlist; 16 | } 17 | 18 | bool 19 | WritePropertyList(CFPropertyListRef propertyList, CFURLRef plistURL, CFPropertyListFormat plistFormat) 20 | { 21 | bool isOK = false; 22 | CFDataRef plistData = NULL; 23 | 24 | if(propertyList != NULL) 25 | plistData = CFPropertyListCreateData(kCFAllocatorDefault, propertyList, plistFormat, 0, NULL); 26 | 27 | if(plistData != NULL) 28 | { 29 | @autoreleasepool 30 | { 31 | isOK = (bool)[(NSData *)plistData 32 | writeToURL:(NSURL *)plistURL 33 | options:0 34 | error:NULL]; 35 | } 36 | CFRelease(plistData); 37 | } 38 | return isOK; 39 | } 40 | -------------------------------------------------------------------------------- /Common/ACFType.cp: -------------------------------------------------------------------------------- 1 | //************************************************************************************** 2 | // Filename: ACFType.cp 3 | // Part of Contextual Menu Workshop by Abracode Inc. 4 | // http://free.abracode.com/cmworkshop/ 5 | // 6 | // Copyright � 2002-2004 Abracode, Inc. All rights reserved. 7 | // 8 | // Description: helper for CoreFountation types 9 | // 10 | // 11 | // 12 | //************************************************************************************** 13 | 14 | #include "ACFType.h" 15 | 16 | //most common CF types that can be used in property lists: 17 | 18 | template <> CFTypeID ACFType::sTypeID = ::CFStringGetTypeID(); 19 | template <> CFTypeID ACFType::sTypeID = ::CFStringGetTypeID(); 20 | template <> CFTypeID ACFType::sTypeID = ::CFDictionaryGetTypeID(); 21 | template <> CFTypeID ACFType::sTypeID = ::CFDictionaryGetTypeID(); 22 | template <> CFTypeID ACFType::sTypeID = ::CFArrayGetTypeID(); 23 | template <> CFTypeID ACFType::sTypeID = ::CFArrayGetTypeID(); 24 | template <> CFTypeID ACFType::sTypeID = ::CFNumberGetTypeID(); 25 | template <> CFTypeID ACFType::sTypeID = ::CFBooleanGetTypeID(); 26 | template <> CFTypeID ACFType::sTypeID = ::CFDataGetTypeID(); 27 | template <> CFTypeID ACFType::sTypeID = ::CFDataGetTypeID(); 28 | template <> CFTypeID ACFType::sTypeID = ::CFDateGetTypeID(); 29 | template <> CFTypeID ACFType::sTypeID = ::CFBundleGetTypeID(); 30 | template <> CFTypeID ACFType::sTypeID = ::CFURLGetTypeID(); 31 | template <> CFTypeID ACFType::sTypeID = ::CFSetGetTypeID(); 32 | template <> CFTypeID ACFType::sTypeID = ::CFSetGetTypeID(); 33 | 34 | //Some other, currently unused CF types. 35 | //Uncomment when needed 36 | #if 0 37 | template <> CFTypeID ACFType::sTypeID = ::CFDateFormatterGetTypeID(); 38 | template <> CFTypeID ACFType::sTypeID = ::CFLocaleGetTypeID(); 39 | template <> CFTypeID ACFType::sTypeID = ::CFNumberFormatterGetTypeID(); 40 | template <> CFTypeID ACFType::sTypeID = ::CFPlugInGetTypeID(); 41 | template <> CFTypeID ACFType::sTypeID = ::CFAllocatorGetTypeID(); 42 | template <> CFTypeID ACFType::sTypeID = ::CFNullGetTypeID(); 43 | template <> CFTypeID ACFType::sTypeID = ::CFBagGetTypeID(); 44 | template <> CFTypeID ACFType::sTypeID = ::CFAttributedStringGetTypeID(); 45 | template <> CFTypeID ACFType::sTypeID = ::CFMessagePortGetTypeID(); 46 | template <> CFTypeID ACFType::sTypeID = ::CFUUIDGetTypeID(); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /Common/ACFType.h: -------------------------------------------------------------------------------- 1 | //************************************************************************************** 2 | // Filename: ACFType.h 3 | // Part of Contextual Menu Workshop by Abracode Inc. 4 | // http://free.abracode.com/cmworkshop/ 5 | // 6 | // Copyright � 2002-2004 Abracode, Inc. All rights reserved. 7 | // 8 | // Description: helper for CoreFountation types 9 | // 10 | // 11 | // 12 | //************************************************************************************** 13 | 14 | #pragma once 15 | 16 | #include 17 | 18 | template class ACFType 19 | { 20 | public: 21 | 22 | //dynamic_cast for CoreFoundation objects 23 | static T DynamicCast(CFTypeRef inValue) noexcept 24 | { 25 | if( (inValue == nullptr) || (::CFGetTypeID(inValue) != sTypeID) ) 26 | return nullptr; 27 | return (T)inValue; 28 | } 29 | 30 | //specialized version which does not change the original value of outValue 31 | //if the cast did not succeed. it returns false instead to indicate a problem 32 | //designed for ACFDict so getting non-existing key does not change the default value 33 | static bool DynamicCast(CFTypeRef inValue, T &outValue) noexcept 34 | { 35 | if( (inValue == nullptr) || (::CFGetTypeID(inValue) != sTypeID) ) 36 | return false; 37 | outValue = (T)inValue; 38 | return true; 39 | } 40 | 41 | static CFTypeID GetTypeID() noexcept { return sTypeID; } 42 | 43 | static CFTypeID sTypeID; 44 | }; 45 | 46 | template <> CFTypeID ACFType::sTypeID; 47 | template <> CFTypeID ACFType::sTypeID; 48 | template <> CFTypeID ACFType::sTypeID; 49 | template <> CFTypeID ACFType::sTypeID; 50 | template <> CFTypeID ACFType::sTypeID; 51 | template <> CFTypeID ACFType::sTypeID; 52 | template <> CFTypeID ACFType::sTypeID; 53 | template <> CFTypeID ACFType::sTypeID; 54 | template <> CFTypeID ACFType::sTypeID; 55 | template <> CFTypeID ACFType::sTypeID; 56 | template <> CFTypeID ACFType::sTypeID; 57 | template <> CFTypeID ACFType::sTypeID; 58 | template <> CFTypeID ACFType::sTypeID; 59 | template <> CFTypeID ACFType::sTypeID; 60 | template <> CFTypeID ACFType::sTypeID; 61 | -------------------------------------------------------------------------------- /Common/ACFURL.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | bool DeleteFile(CFURLRef fileURL); 9 | 10 | CFURLRef CopyPreferencesDirURL(void); 11 | CFURLRef CopyApplicationSupportDirURL(void); 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | 18 | -------------------------------------------------------------------------------- /Common/ACFURL.m: -------------------------------------------------------------------------------- 1 | #include "ACFURL.h" 2 | #import 3 | 4 | bool DeleteFile(CFURLRef fileURL) 5 | { 6 | @autoreleasepool 7 | { 8 | NSFileManager *fileManager = [NSFileManager defaultManager]; 9 | return (bool)[fileManager removeItemAtURL:(NSURL*)fileURL error:NULL]; 10 | } 11 | } 12 | 13 | CFURLRef CopyPreferencesDirURL(void) 14 | { 15 | @autoreleasepool 16 | { 17 | NSFileManager *fileManager = [NSFileManager defaultManager]; 18 | NSURL *userLibraryDirURL = [fileManager 19 | URLForDirectory:NSLibraryDirectory 20 | inDomain:NSUserDomainMask 21 | appropriateForURL:NULL 22 | create:YES 23 | error:NULL]; 24 | if(userLibraryDirURL == NULL) 25 | return NULL; 26 | 27 | NSURL *prefsURL = [userLibraryDirURL URLByAppendingPathComponent:@"Preferences" isDirectory:YES]; 28 | [prefsURL retain]; 29 | return (CFURLRef)prefsURL; 30 | } 31 | } 32 | 33 | CFURLRef CopyApplicationSupportDirURL(void) 34 | { 35 | @autoreleasepool 36 | { 37 | NSFileManager *fileManager = [NSFileManager defaultManager]; 38 | NSURL *userAppSupportDirURL = [fileManager 39 | URLForDirectory:NSApplicationSupportDirectory 40 | inDomain:NSUserDomainMask 41 | appropriateForURL:NULL 42 | create:YES 43 | error:NULL]; 44 | [userAppSupportDirURL retain]; 45 | return (CFURLRef)userAppSupportDirURL; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Common/ACMPlugin.cp: -------------------------------------------------------------------------------- 1 | //************************************************************************************** 2 | // Filename: ACMPlugin.cp 3 | // Part of Abracode Workshop. 4 | // 5 | // Description: Base code for CM plugin taking care of COM interface and communication with a host. 6 | // Not needed to be modified in most cases. 7 | // 8 | // Usage: see Documentation.txt 9 | // 10 | // License: FreeBSD-like 11 | // 12 | //************************************************************************************** 13 | 14 | 15 | #include "ACMPlugin.h" 16 | #include "CFObj.h" 17 | #include "DebugSettings.h" 18 | 19 | ACMPlugin::ACMPlugin(CFStringRef inBundleID) 20 | { 21 | TRACE_CSTR( "ACMPlugin::ACMPlugin\n" ); 22 | 23 | if(inBundleID != NULL) 24 | mBundleRef.Adopt( ::CFBundleGetBundleWithIdentifier(inBundleID), kCFObjRetain ); 25 | 26 | #if 0 //_DEBUG_ 27 | if( (CFBundleRef)mBundleRef != NULL) 28 | { 29 | CFIndex bundleRetainCount = ::CFGetRetainCount( (CFBundleRef)mBundleRef ); 30 | DEBUG_CSTR("ACMPlugin::ACMPlugin. CFBundleRef retain count after getting it and retaining is %d\n", (int)bundleRetainCount ); 31 | } 32 | else 33 | { 34 | DEBUG_CSTR("CFBundleGetBundleWithIdentifier returned NULL!\n"); 35 | } 36 | #endif 37 | } 38 | 39 | ACMPlugin::~ACMPlugin() 40 | { 41 | TRACE_CSTR( "ACMPlugin::~ACMPlugin\n" ); 42 | 43 | #if 0 //_DEBUG_ 44 | if( (CFBundleRef)mBundleRef != NULL) 45 | { 46 | CFIndex bundleRetainCount = ::CFGetRetainCount( (CFBundleRef)mBundleRef ); 47 | DEBUG_CSTR("ACMPlugin::~ACMPlugin(). CFBundleRef retain count before release is %d\n", (int)bundleRetainCount ); 48 | } 49 | else 50 | { 51 | DEBUG_CSTR("ACMPlugin::~ACMPlugin. NULL mBundleRef!\n"); 52 | } 53 | #endif 54 | } 55 | -------------------------------------------------------------------------------- /Common/ACMPlugin.h: -------------------------------------------------------------------------------- 1 | 2 | //************************************************************************************** 3 | // Filename: ACMPlugin.h 4 | // Part of Abracode Workshop 5 | // 6 | // Description: Base code for CM plugin taking care of COM interface and communication with a host. 7 | // Not needed to be modified in most cases. 8 | // 9 | // Usage: see Documentation.txt 10 | // 11 | //************************************************************************************** 12 | 13 | 14 | #ifndef __ACMPlugin__ 15 | #define __ACMPlugin__ 16 | 17 | #include 18 | #include "ARefCounted.h" 19 | #include "CFObj.h" 20 | 21 | class ACMPlugin : public ARefCounted 22 | { 23 | public: 24 | 25 | ACMPlugin(CFStringRef inBundleID); 26 | virtual ~ACMPlugin(); 27 | 28 | virtual OSStatus ExamineContext( const AEDesc *inContext, AEDescList *outCommandPairs ) = 0; 29 | virtual OSStatus HandleSelection( AEDesc *inContext, SInt32 inCommandID ) = 0; 30 | virtual void PostMenuCleanup() = 0; 31 | virtual CFBundleRef GetBundleRef() const { return mBundleRef; } 32 | protected: 33 | CFObj mBundleRef; 34 | }; 35 | 36 | //plugin should implement this method and return a new object inherited from ACMPlugin 37 | ACMPlugin *CreateNewCMPlugin(); 38 | extern CFUUIDRef kCMPluginFactoryID; //client provides this symbol with unique ID 39 | 40 | #endif //__ACMPlugin__ 41 | -------------------------------------------------------------------------------- /Common/AObserverBase.h: -------------------------------------------------------------------------------- 1 | //************************************************************************************** 2 | // Filename: AObserverBase.h 3 | // Part of Contextual Menu Workshop by Abracode Inc. 4 | // http://free.abracode.com/cmworkshop/ 5 | // 6 | // Copyright © 2002-2004 Abracode, Inc. All rights reserved. 7 | // 8 | // Description: AObserverBase defines common notification API but not the protocol details 9 | // 10 | // 11 | // 12 | //************************************************************************************** 13 | 14 | #pragma once 15 | #include "ARefCounted.h" 16 | 17 | class ANotifier; 18 | 19 | class AObserverBase : public ARefCounted 20 | { 21 | public: 22 | virtual ~AObserverBase() { } //just to shut up the GCC compiler warning 23 | 24 | virtual void ReceiveNotification(void *ioData) const = 0; 25 | 26 | protected: 27 | virtual void AddNotifier(const ANotifier *inNotifier) const = 0; 28 | virtual void RemoveNotifier(const ANotifier *inNotifier) const = 0; 29 | 30 | friend class ANotifier; 31 | }; 32 | -------------------------------------------------------------------------------- /Common/ARefCounted.cp: -------------------------------------------------------------------------------- 1 | //************************************************************************************** 2 | // Filename: ACFType.cp 3 | // Part of Contextual Menu Workshop by Abracode Inc. 4 | // http://free.abracode.com/cmworkshop/ 5 | // 6 | // Copyright © 2002-2004 Abracode, Inc. All rights reserved. 7 | // 8 | // Description: helper for CoreFountation types 9 | // 10 | // 11 | // 12 | //************************************************************************************** 13 | 14 | #include "ARefCounted.h" 15 | 16 | const CFArrayCallBacks ARefCounted::sCFArrayCallbacks = 17 | { 18 | 0, //version 19 | ARefCounted::RetainCallback, 20 | ARefCounted::ReleaseCallback, 21 | NULL, //copyDescription 22 | NULL //equal 23 | }; 24 | 25 | const CFSetCallBacks ARefCounted::sCFSetCallbacks = 26 | { 27 | 0, //version 28 | ARefCounted::RetainCallback, 29 | ARefCounted::ReleaseCallback, 30 | NULL, //copyDescription 31 | NULL, //equal; 32 | NULL //hash; 33 | }; 34 | 35 | const CFDictionaryValueCallBacks ARefCounted::sCFDictionaryCallbacks = 36 | { 37 | 0, //version 38 | ARefCounted::RetainCallback, 39 | ARefCounted::ReleaseCallback, 40 | NULL, //copyDescription 41 | NULL //equal 42 | }; 43 | -------------------------------------------------------------------------------- /Common/AUniquePtr.h: -------------------------------------------------------------------------------- 1 | //************************************************************************************** 2 | // Filename: AUniquePtr.h 3 | // 4 | // Description: equivalent of std::unique_ptr with a couple of tweaks 5 | //************************************************************************************** 6 | 7 | #pragma once 8 | #include 9 | 10 | template 11 | class AUniquePtr : public std::unique_ptr 12 | { 13 | public: 14 | AUniquePtr() noexcept 15 | : std::unique_ptr(nullptr) 16 | {} 17 | 18 | AUniquePtr(T* inObj) noexcept 19 | : std::unique_ptr(inObj) 20 | {} 21 | 22 | AUniquePtr(AUniquePtr& inOrig) noexcept 23 | : std::unique_ptr(inOrig.detach()) 24 | { 25 | } 26 | 27 | //std::unique_ptr does not have automatic extraction of underlying pointer 28 | //I can't live without it 29 | operator T*() const noexcept 30 | { 31 | return this->get(); 32 | } 33 | 34 | T* detach() noexcept 35 | { 36 | return this->release(); //release is a very bad misnomer because the term is reserved in many ref-counted APIs 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /Common/DebugSettings.h: -------------------------------------------------------------------------------- 1 | //************************************************************************************** 2 | // Filename: DebugSettings.h 3 | // Part of Contextual Menu Workshop by Abracode Inc. 4 | // http://free.abracode.com/cmworkshop/ 5 | // Copyright � 2003 Abracode, Inc. All rights reserved. 6 | // 7 | // Description: 8 | // 9 | //************************************************************************************** 10 | // Revision History: 11 | // Friday, March 7, 2003 - Original 12 | //************************************************************************************** 13 | 14 | #pragma once 15 | 16 | #ifndef _DEBUG_ 17 | #define _DEBUG_ 0 18 | #endif 19 | 20 | #ifndef _TRACE_ 21 | #define _TRACE_ 0 22 | #endif 23 | 24 | #if (_DEBUG_ == 1) 25 | #define DEBUG_CFSTR(_iCFStr) CFShow(_iCFStr) 26 | #define DEBUG_CSTR printf 27 | #else 28 | #define DEBUG_CFSTR(_iCFStr) 29 | #define DEBUG_CSTR(...) 30 | #endif //(_DEBUG_ == 1) 31 | 32 | #if (_TRACE_ == 1) 33 | #define TRACE_CFSTR(_iCFStr) CFShow(_iCFStr) 34 | #define TRACE_CSTR printf 35 | #else 36 | #define TRACE_CFSTR(_iCFStr) 37 | #define TRACE_CSTR(...) 38 | #endif //(_DEBUG_ == 1) 39 | 40 | #define LOG_CFSTR(_iCFStr) CFShow(_iCFStr) 41 | #define LOG_CSTR printf 42 | -------------------------------------------------------------------------------- /Common/MessagePortSend.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * MessagePortSend.cpp 3 | * OnMyCommandCM 4 | * 5 | * Created by Tomasz Kukielka on 11/25/06. 6 | * Copyright 2006 Abracode. All rights reserved. 7 | * 8 | */ 9 | 10 | #include "MessagePortSend.h" 11 | #include "CFObj.h" 12 | 13 | SInt32 14 | SendMessageToRemotePortWithoutResponse(CFStringRef inPort, SInt32 inMsgId, CFDataRef dataToSend) 15 | { 16 | CFObj remotePort( ::CFMessagePortCreateRemote(kCFAllocatorDefault, inPort) ); 17 | if(remotePort != NULL) 18 | { 19 | return ::CFMessagePortSendRequest( 20 | remotePort, 21 | inMsgId, 22 | dataToSend, 23 | 10,//send timeout 24 | 0,//rcv timout 25 | NULL, //kCFRunLoopDefaultMode 26 | NULL//replyData 27 | ); 28 | } 29 | return kCFMessagePortIsInvalid; 30 | } 31 | 32 | CFDataRef 33 | SendMessageToRemotePortWithResponse(CFStringRef inPort, SInt32 inMsgId, CFDataRef dataToSend) 34 | { 35 | CFDataRef outReplyData = NULL; 36 | CFObj remotePort( ::CFMessagePortCreateRemote(kCFAllocatorDefault, inPort) ); 37 | if(remotePort != NULL) 38 | { 39 | SInt32 result = ::CFMessagePortSendRequest( 40 | remotePort, 41 | inMsgId, 42 | dataToSend, 43 | 10,//send timeout 44 | 10,//rcv timout 45 | kCFRunLoopDefaultMode, 46 | &outReplyData ); 47 | if( (result != kCFMessagePortSuccess) && (outReplyData != NULL) ) 48 | { 49 | ::CFRelease(outReplyData); 50 | outReplyData = NULL; 51 | } 52 | } 53 | return outReplyData; 54 | } 55 | -------------------------------------------------------------------------------- /Common/MessagePortSend.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MessagePortSend.h 3 | * Contextual Menu Workshop 4 | * 5 | * Created by Tomasz Kukielka on 11/25/06. 6 | * Copyright 2006 Abracode. All rights reserved. 7 | * 8 | */ 9 | 10 | #pragma once 11 | 12 | #include 13 | 14 | SInt32 SendMessageToRemotePortWithoutResponse(CFStringRef inPort, SInt32 inMsgId, CFDataRef dataToSend); 15 | CFDataRef SendMessageToRemotePortWithResponse(CFStringRef inPort, SInt32 inMsgId, CFDataRef dataToSend); 16 | 17 | -------------------------------------------------------------------------------- /Common/OmcProjectCommon.xcconfig: -------------------------------------------------------------------------------- 1 | #include "OmcVersion.xcconfig" 2 | 3 | // This code sign identity allows running the built binaries on local machine: 4 | CODE_SIGN_IDENTITY = - 5 | DEVELOPMENT_TEAM = 6 | 7 | // Optional xcconfig with code signing settings for distribution by Abracode 8 | #include? "OmcDistribution.xcconfig" 9 | 10 | 11 | MACOSX_DEPLOYMENT_TARGET = 10.13 12 | SDKROOT = macosx 13 | FRAMEWORK_SEARCH_PATHS = /Library/Frameworks 14 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0 15 | CLANG_CXX_LANGUAGE_STANDARD = c++17 16 | 17 | CLANG_ENABLE_OBJC_WEAK = YES 18 | CLANG_ENABLE_MODULES = YES 19 | 20 | ALWAYS_SEARCH_USER_PATHS = NO 21 | INFOPLIST_PREPROCESS = YES 22 | 23 | SYMROOT = ../build 24 | 25 | //Obj-C 26 | ENABLE_STRICT_OBJC_MSGSEND = YES 27 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR 28 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 29 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES 30 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES 31 | GCC_WARN_UNDECLARED_SELECTOR = YES 32 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR 33 | 34 | //C++ 35 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES 36 | CLANG_WARN_SUSPICIOUS_MOVE = YES 37 | 38 | //All lanugages: 39 | 40 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES 41 | CLANG_WARN_EMPTY_BODY = YES 42 | CLANG_WARN_BOOL_CONVERSION = YES 43 | CLANG_WARN_CONSTANT_CONVERSION = YES 44 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES 45 | CLANG_WARN_ENUM_CONVERSION = YES 46 | CLANG_WARN_INT_CONVERSION = YES 47 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES 48 | CLANG_WARN_INFINITE_RECURSION = YES 49 | GCC_WARN_ABOUT_RETURN_TYPE = YES 50 | CLANG_WARN_STRICT_PROTOTYPES = YES 51 | CLANG_WARN_COMMA = YES 52 | GCC_WARN_UNINITIALIZED_AUTOS = YES 53 | CLANG_WARN_UNREACHABLE_CODE = YES 54 | GCC_WARN_UNUSED_FUNCTION = YES 55 | GCC_WARN_UNUSED_VARIABLE = YES 56 | 57 | 58 | -------------------------------------------------------------------------------- /Common/OmcProjectDebug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "OmcProjectCommon.xcconfig" 2 | 3 | ONLY_ACTIVE_ARCH = YES 4 | ENABLE_TESTABILITY = YES 5 | GCC_OPTIMIZATION_LEVEL = 0 6 | 7 | COPY_PHASE_STRIP = NO 8 | 9 | GCC_PREPROCESSOR_DEFINITIONS = $(OMC_VERSION_DEFINITIONS) _DEBUG_=1 _TRACE_=0 DEBUG=1 10 | -------------------------------------------------------------------------------- /Common/OmcProjectRelease.xcconfig: -------------------------------------------------------------------------------- 1 | #include "OmcProjectCommon.xcconfig" 2 | 3 | DEAD_CODE_STRIPPING = YES 4 | DEBUG_INFORMATION_FORMAT = dwarf-with-dsym 5 | 6 | GCC_PREPROCESSOR_DEFINITIONS = $(OMC_VERSION_DEFINITIONS) _DEBUG_=0 _TRACE_=0 NDEBUG=1 7 | ENABLE_NS_ASSERTIONS = NO 8 | -------------------------------------------------------------------------------- /Common/OmcTool_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | ${PRODUCT_BUNDLE_IDENTIFIER} 7 | CFBundleName 8 | ${PRODUCT_NAME} 9 | CFBundleVersion 10 | ${OMC_BUNDLE_VERSION} 11 | LSMinimumSystemVersion 12 | ${MACOSX_DEPLOYMENT_TARGET} 13 | 14 | 15 | -------------------------------------------------------------------------------- /Common/OmcVersion.xcconfig: -------------------------------------------------------------------------------- 1 | OMC_BUNDLE_VERSION = 4.2.1 2 | 3 | //2 digits per version point : 3.2.0 = 03 02 00 4 | OMC_VERSION_DEFINITIONS = CURRENT_OMC_VERSION=40201 MIN_OMC_VERSION=30200 MIN_MAC_OS_VERSION=101300 MAX_MAC_OS_VERSION=999999 5 | -------------------------------------------------------------------------------- /Common/PlistPreferences.cp: -------------------------------------------------------------------------------- 1 | #include "PlistPreferences.h" 2 | #include "CFObj.h" 3 | #include "ACFType.h" 4 | 5 | PlistPreferences::PlistPreferences(CFStringRef inPrefsIdentifier) 6 | : mPrefsIdentifier(inPrefsIdentifier) 7 | { 8 | if(mPrefsIdentifier != NULL) 9 | ::CFRetain(mPrefsIdentifier); 10 | } 11 | 12 | 13 | PlistPreferences::~PlistPreferences() 14 | { 15 | if(mPrefsIdentifier != NULL) 16 | ::CFRelease(mPrefsIdentifier); 17 | } 18 | 19 | void 20 | PlistPreferences::Init() 21 | { 22 | } 23 | 24 | 25 | void 26 | PlistPreferences::Read() 27 | { 28 | Init(); 29 | ::CFPreferencesAppSynchronize( mPrefsIdentifier ); 30 | } 31 | 32 | void 33 | PlistPreferences::Save() 34 | { 35 | ::CFPreferencesAppSynchronize( mPrefsIdentifier ); 36 | } 37 | 38 | //sets the output value only if the key exists in prefs. otherwise value remains unchanged (presumably inited to default value) 39 | Boolean 40 | PlistPreferences::GetBoolValueForKey(CFStringRef inKey, Boolean &outBoolValue) 41 | { 42 | Boolean isValid = false; 43 | Boolean boolValue = ::CFPreferencesGetAppBooleanValue(inKey, mPrefsIdentifier, &isValid ); 44 | if( isValid ) 45 | outBoolValue = boolValue; 46 | 47 | return isValid; 48 | } 49 | 50 | void 51 | PlistPreferences::SetBoolValueForKey(CFStringRef inKey, Boolean inBoolValue) 52 | { 53 | ::CFPreferencesSetAppValue( inKey, inBoolValue ? kCFBooleanTrue : kCFBooleanFalse, mPrefsIdentifier ); 54 | } 55 | 56 | 57 | //sets the output value only if the key exists in prefs. otherwise value remains unchanged (presumably inited to default value) 58 | Boolean 59 | PlistPreferences::GetIntegerValueForKey(CFStringRef inKey, CFIndex &outIntValue) 60 | { 61 | Boolean isValid = false; 62 | CFIndex intValue = ::CFPreferencesGetAppIntegerValue(inKey, mPrefsIdentifier, &isValid ); 63 | if( isValid ) 64 | outIntValue = intValue; 65 | 66 | return isValid; 67 | } 68 | 69 | void 70 | PlistPreferences::SetIntegerValueForKey(CFStringRef inKey, CFIndex inIntValue) 71 | { 72 | CFObj theNum = ::CFNumberCreate(kCFAllocatorDefault, kCFNumberLongType, &inIntValue); 73 | if(theNum != nullptr) 74 | { 75 | ::CFPreferencesSetAppValue( inKey, theNum, mPrefsIdentifier ); 76 | } 77 | } 78 | 79 | 80 | //caller responslible for releasing non-null outString 81 | 82 | CFStringRef 83 | PlistPreferences::CopyStringForKey(CFStringRef inKey) 84 | { 85 | CFObj resultRef( ::CFPreferencesCopyAppValue(inKey, mPrefsIdentifier) ); 86 | if( ACFType::DynamicCast(resultRef) != NULL ) 87 | return (CFStringRef)resultRef.Detach(); 88 | return nullptr; 89 | } 90 | 91 | void 92 | PlistPreferences::SetStringForKey(CFStringRef inKey, CFStringRef inString) 93 | { 94 | ::CFPreferencesSetAppValue( inKey, inString, mPrefsIdentifier ); 95 | } 96 | 97 | -------------------------------------------------------------------------------- /Common/PlistPreferences.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | 5 | class PlistPreferences 6 | { 7 | public: 8 | PlistPreferences(CFStringRef inPrefsIdentifier); 9 | virtual ~PlistPreferences(); 10 | 11 | virtual void Init() = 0; 12 | virtual void Read(); 13 | virtual void Save(); 14 | 15 | Boolean GetBoolValueForKey(CFStringRef inKey, Boolean &outBoolValue); 16 | void SetBoolValueForKey(CFStringRef inKey, Boolean inBoolValue); 17 | 18 | Boolean GetIntegerValueForKey(CFStringRef inKey, CFIndex &outIntValue); 19 | void SetIntegerValueForKey(CFStringRef inKey, CFIndex inIntValue); 20 | 21 | CFStringRef CopyStringForKey(CFStringRef inKey); 22 | void SetStringForKey(CFStringRef inKey, CFStringRef inString); 23 | 24 | protected: 25 | CFStringRef mPrefsIdentifier; 26 | 27 | }; 28 | 29 | -------------------------------------------------------------------------------- /Common/StAEDesc.h: -------------------------------------------------------------------------------- 1 | //************************************************************************************** 2 | // Filename: StAEDesc.h 3 | // Part of Contextual Menu Workshop by Abracode Inc. 4 | // http://free.abracode.com/cmworkshop/ 5 | // Copyright � 2002-2004 Abracode, Inc. All rights reserved. 6 | // 7 | // Description: very primitive. use PowerPlant's StAEDescriptor if you prefer 8 | // but note that this one does not throw 9 | // 10 | // 11 | //************************************************************************************** 12 | // Revision History: 13 | // Friday, January 25, 2002 - Original 14 | //************************************************************************************** 15 | 16 | #pragma once 17 | #import 18 | 19 | //no virtual methods so the memory layout is identical to AEDesc 20 | 21 | class StAEDesc : public AEDesc 22 | { 23 | public: 24 | StAEDesc() noexcept 25 | { 26 | Init(); 27 | } 28 | 29 | StAEDesc(const AEDesc &inDesc) noexcept 30 | {//just take ownership, do not copy 31 | this->descriptorType = inDesc.descriptorType; 32 | this->dataHandle = inDesc.dataHandle; 33 | } 34 | 35 | StAEDesc(DescType inType, const void *inDataPtr, Size inSize) noexcept 36 | { 37 | ::AECreateDesc(inType, inDataPtr, inSize, this); 38 | } 39 | 40 | ~StAEDesc() noexcept 41 | { 42 | if(dataHandle != nullptr ) 43 | { 44 | ::AEDisposeDesc( this ); 45 | } 46 | } 47 | 48 | void Init() noexcept 49 | { 50 | AEInitializeDescInline(this); 51 | } 52 | 53 | DescType GetDescriptorType() const noexcept { return this->descriptorType; } 54 | AEDataStorage GetDataStorage() const noexcept { return this->dataHandle; } 55 | 56 | OSErr GetData(void *ioData, Size inDataSize) const noexcept 57 | { 58 | return ::AEGetDescData(this, ioData, inDataSize); 59 | } 60 | 61 | bool IsNULL() const noexcept { return (this->descriptorType == typeNull); } 62 | 63 | AEDesc Detach() noexcept 64 | { 65 | AEDesc outDesc = *this; 66 | Init(); 67 | return outDesc; 68 | } 69 | 70 | /* 71 | operator AEDesc& () 72 | { 73 | return *this; 74 | } 75 | 76 | operator const AEDesc& () const 77 | { 78 | return *this; 79 | } 80 | */ 81 | 82 | operator AEDesc* () noexcept 83 | { 84 | return this; 85 | } 86 | 87 | operator const AEDesc* () const noexcept 88 | { 89 | return this; 90 | } 91 | 92 | private: 93 | StAEDesc(const StAEDesc&); 94 | StAEDesc& operator=(const StAEDesc&); 95 | }; 96 | -------------------------------------------------------------------------------- /Common/StSwitchToFront.h: -------------------------------------------------------------------------------- 1 | //************************************************************************************** 2 | // Filename: StSwitchToFront.h 3 | //************************************************************************************** 4 | 5 | #pragma once 6 | #include 7 | 8 | class StSwitchToFront 9 | { 10 | public: 11 | StSwitchToFront(bool inRestore = true) noexcept; 12 | ~StSwitchToFront() noexcept; 13 | 14 | private: 15 | pid_t mPreviousFrontAppPID { 0 }; 16 | }; 17 | -------------------------------------------------------------------------------- /Common/StSwitchToFront.mm: -------------------------------------------------------------------------------- 1 | //************************************************************************************** 2 | // Filename: StSwitchToFront.cp 3 | // 4 | // Description: switched current process to front if not front already and restores 5 | // front application on destruction 6 | // 7 | //************************************************************************************** 8 | 9 | #include "StSwitchToFront.h" 10 | 11 | StSwitchToFront::StSwitchToFront(bool inRestore /*= true*/) noexcept 12 | { 13 | @autoreleasepool 14 | { 15 | NSRunningApplication *currentApp = [NSRunningApplication currentApplication]; 16 | BOOL isCurrAppActive = [currentApp isActive]; 17 | if(!isCurrAppActive) 18 | { 19 | if(inRestore) 20 | { 21 | NSRunningApplication *frontmostApp = [[NSWorkspace sharedWorkspace] frontmostApplication]; 22 | mPreviousFrontAppPID = [frontmostApp processIdentifier]; 23 | } 24 | /*BOOL isOK =*/ [currentApp activateWithOptions:(NSApplicationActivateAllWindows | NSApplicationActivateIgnoringOtherApps)]; 25 | } 26 | } 27 | } 28 | 29 | StSwitchToFront::~StSwitchToFront(void) noexcept 30 | { 31 | @autoreleasepool 32 | { 33 | if(mPreviousFrontAppPID != 0) 34 | { 35 | NSRunningApplication *previousFrontApp = [NSRunningApplication runningApplicationWithProcessIdentifier:mPreviousFrontAppPID]; 36 | if(previousFrontApp != nil) 37 | { 38 | /*BOOL isOK =*/ [previousFrontApp activateWithOptions:(NSApplicationActivateAllWindows | NSApplicationActivateIgnoringOtherApps)]; 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Tomasz Kukielka 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /OMC.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 12 | 13 | 15 | 16 | 18 | 19 | 21 | 22 | 24 | 25 | 27 | 28 | 30 | 31 | 33 | 34 | 36 | 37 | 39 | 40 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /OMC.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /OMCApplet/Base.lproj/MainMenu.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/OMCApplet/Base.lproj/MainMenu.nib/keyedobjects.nib -------------------------------------------------------------------------------- /OMCApplet/Command-release.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | COMMAND_LIST 6 | 7 | 8 | COMMAND 9 | 10 | echo "Welcome to OMC" 11 | 12 | END_NOTIFICATION 13 | 14 | NAME 15 | Welcome 16 | REQUIRED_MAC_OS_MIN_VERSION 17 | 10.13 18 | REQUIRED_OMC_VERSION 19 | 4.0 20 | VERSION 21 | 1 22 | 23 | 24 | VERSION 25 | 2 26 | 27 | 28 | -------------------------------------------------------------------------------- /OMCApplet/Command.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | COMMAND_LIST 6 | 7 | 8 | COMMAND 9 | 10 | echo "Welcome to OMC" 11 | 12 | END_NOTIFICATION 13 | 14 | NAME 15 | Welcome 16 | REQUIRED_MAC_OS_MIN_VERSION 17 | 10.13 18 | REQUIRED_OMC_VERSION 19 | 4.0 20 | VERSION 21 | 1 22 | 23 | 24 | VERSION 25 | 2 26 | 27 | 28 | -------------------------------------------------------------------------------- /OMCApplet/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDocumentTypes 8 | 9 | 10 | CFBundleTypeExtensions 11 | 12 | * 13 | 14 | CFBundleTypeOSTypes 15 | 16 | **** 17 | 18 | CFBundleTypeRole 19 | Viewer 20 | 21 | 22 | CFBundleExecutable 23 | ${EXECUTABLE_NAME} 24 | CFBundleIconFile 25 | app.icns 26 | CFBundleIdentifier 27 | com.abracode.${PRODUCT_NAME:identifier} 28 | CFBundleInfoDictionaryVersion 29 | 6.0 30 | CFBundleName 31 | ${PRODUCT_NAME} 32 | CFBundlePackageType 33 | APPL 34 | CFBundleSignature 35 | OMCd 36 | CFBundleVersion 37 | ${OMC_BUNDLE_VERSION} 38 | NSMainNibFile 39 | MainMenu 40 | NSPrincipalClass 41 | NSApplication 42 | LSMinimumSystemVersion 43 | ${MACOSX_DEPLOYMENT_TARGET} 44 | CFBundleURLTypes 45 | 46 | 47 | CFBundleURLName 48 | OMC Command 49 | CFBundleURLSchemes 50 | 51 | applet_unique_url_scheme 52 | 53 | 54 | 55 | NSAppleEventsUsageDescription 56 | OMC Applets send AppleEvents to other apps to provide some great functionality which is unique to each applet and should be explicitly explained here 57 | NSAppTransportSecurity 58 | 59 | NSAllowsArbitraryLoadsInWebContent 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /OMCApplet/OMCApplet.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.automation.apple-events 6 | 7 | com.apple.security.cs.disable-library-validation 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /OMCApplet/OMCApplet.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OMCApplet/OMCApplet.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /OMCApplet/OMCApplet.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /OMCApplet/OMCApplet_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'OMCApplet' target in the 'OMCApplet' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /OMCApplet/app.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/OMCApplet/app.icns -------------------------------------------------------------------------------- /OMCApplet/de.lproj/MainMenu.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/OMCApplet/de.lproj/MainMenu.nib/keyedobjects.nib -------------------------------------------------------------------------------- /OMCApplet/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleGetInfoString 6 | OMCApplet version 4.2.1 7 | CFBundleName 8 | OMCApplet 9 | NSHumanReadableCopyright 10 | Copyright Abracode 11 | 12 | 13 | -------------------------------------------------------------------------------- /OMCApplet/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OMCApplet 4 | // 5 | // Created by Tomasz Kukielka on 6/7/08. 6 | // Copyright Abracode Inc 2008. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | UInt32 GetAbracodeFrameworkVersion(void); 12 | 13 | #define MINIMUM_OMC_VERSION 20000 14 | 15 | int main(int argc, char *argv[]) 16 | { 17 | if(GetAbracodeFrameworkVersion() >= MINIMUM_OMC_VERSION) 18 | { 19 | return NSApplicationMain(argc, (const char **) argv); 20 | } 21 | return 1; 22 | } 23 | -------------------------------------------------------------------------------- /OMCService/Command.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | COMMAND_LIST 6 | 7 | 8 | ACTIVATION_MODE 9 | act_selected_text 10 | COMMAND 11 | 12 | echo "Example Command" 13 | 14 | ESCAPE_SPECIAL_CHARS 15 | esc_with_backslash 16 | EXECUTION_MODE 17 | exe_silent_popen 18 | NAME 19 | 20 | Example Command 21 | 22 | VERSION 23 | 1 24 | 25 | 26 | VERSION 27 | 2 28 | 29 | 30 | -------------------------------------------------------------------------------- /OMCService/OMCService-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | app.icns 11 | CFBundleIdentifier 12 | ${PRODUCT_BUNDLE_IDENTIFIER} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | ${OMC_BUNDLE_VERSION} 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | ${OMC_BUNDLE_VERSION} 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | LSUIElement 28 | 1 29 | NSAppleEventsUsageDescription 30 | OMCService sends Apple Events to other apps to obtain information about current selection 31 | NSMainNibFile 32 | MainMenu 33 | NSPrincipalClass 34 | NSApplication 35 | NSServices 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /OMCService/OMCService.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.automation.apple-events 6 | 7 | com.apple.security.cs.disable-library-validation 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /OMCService/OMCService.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OMCService/OMCService.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /OMCService/OMCService_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'OMCService' target in the 'OMCService' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /OMCService/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OMCService 4 | // 5 | // Created by Tomasz Kukielka on 1/20/11. 6 | // Copyright 2011 Abracode. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **) argv); 14 | } 15 | -------------------------------------------------------------------------------- /OMCTestApp/Base.lproj/Example1.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/OMCTestApp/Base.lproj/Example1.nib/keyedobjects.nib -------------------------------------------------------------------------------- /OMCTestApp/Base.lproj/ImageKit.nib/designable.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /OMCTestApp/Base.lproj/ImageKit.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/OMCTestApp/Base.lproj/ImageKit.nib/keyedobjects.nib -------------------------------------------------------------------------------- /OMCTestApp/Base.lproj/LegacyWebKit.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/OMCTestApp/Base.lproj/LegacyWebKit.nib/keyedobjects.nib -------------------------------------------------------------------------------- /OMCTestApp/Base.lproj/MainMenu.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/OMCTestApp/Base.lproj/MainMenu.nib/keyedobjects.nib -------------------------------------------------------------------------------- /OMCTestApp/Base.lproj/QCDialog.nib/designable.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /OMCTestApp/Base.lproj/QCDialog.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/OMCTestApp/Base.lproj/QCDialog.nib/keyedobjects.nib -------------------------------------------------------------------------------- /OMCTestApp/Base.lproj/QuickTime.nib/designable.nib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /OMCTestApp/Base.lproj/QuickTime.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/OMCTestApp/Base.lproj/QuickTime.nib/keyedobjects.nib -------------------------------------------------------------------------------- /OMCTestApp/Base.lproj/WebKitView.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/OMCTestApp/Base.lproj/WebKitView.nib/keyedobjects.nib -------------------------------------------------------------------------------- /OMCTestApp/Command-minimal.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | COMMAND_LIST 6 | 7 | 8 | COMMAND 9 | 10 | echo "minimal" 11 | 12 | NAME 13 | 14 | Minimal 15 | 16 | VERSION 17 | 1 18 | 19 | 20 | VERSION 21 | 2 22 | 23 | 24 | -------------------------------------------------------------------------------- /OMCTestApp/Example.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | COMMAND_LIST 6 | 7 | 8 | COMMAND 9 | 10 | echo "Hello World"; 11 | 12 | END_NOTIFICATION 13 | 14 | NAME 15 | Example Command 16 | REQUIRED_MAC_OS_MIN_VERSION 17 | 10.4 18 | REQUIRED_OMC_VERSION 19 | 1.8 20 | VERSION 21 | 1 22 | 23 | 24 | ACTIVATION_MODE 25 | act_selected_text 26 | COMMAND 27 | 28 | echo " 29 | __OBJ_TEXT__ 30 | " 31 | 32 | ESCAPE_SPECIAL_CHARS 33 | esc_none 34 | EXECUTION_MODE 35 | exe_popen_with_output_window 36 | NAME 37 | 38 | Text Context 39 | 40 | OUTPUT_WINDOW_SETTINGS 41 | 42 | AUTO_CLOSE_ON_SUCCESS_ONLY 43 | 44 | AUTO_CLOSE_TIMEOUT 45 | -1 46 | BACKGROUND_COLOR 47 | FFFFFF 48 | TEXT_COLOR 49 | 000000 50 | TEXT_FONT 51 | Monaco 52 | TEXT_SIZE 53 | 10 54 | WINDOW_ALPHA 55 | 1 56 | WINDOW_CLOSE_FADE_OUT 57 | 58 | WINDOW_HEIGHT 59 | 200 60 | WINDOW_OPEN_FADE_IN 61 | 62 | WINDOW_POSITION 63 | alert 64 | WINDOW_TITLE 65 | Untitled 66 | WINDOW_TYPE 67 | floating 68 | WINDOW_WIDTH 69 | 400 70 | 71 | VERSION 72 | 1 73 | 74 | 75 | 76 | VERSION 77 | 2 78 | 79 | 80 | -------------------------------------------------------------------------------- /OMCTestApp/ForOutputObserver.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | COMMAND_LIST 6 | 7 | 8 | ACTIVATION_MODE 9 | act_selected_text 10 | COMMAND 11 | 12 | echo "$OMC_OBJ_TEXT"; echo "Sleep now..."; sleep 2; echo "Now awake!" 13 | 14 | EXECUTION_MODE 15 | exe_silent_popen 16 | NAME 17 | Echo text 18 | NOTES 19 | Echo text context 20 | REQUIRED_OMC_VERSION 21 | 1.9 22 | VERSION 23 | 3 24 | 25 | 26 | VERSION 27 | 2 28 | 29 | 30 | -------------------------------------------------------------------------------- /OMCTestApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.abracode.OMCTestApp 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${OMC_BUNDLE_VERSION} 23 | NSAppleEventsUsageDescription 24 | OMC Test App sends AppleEvents to other apps to test OMC AppleScript functionality 25 | NSAppTransportSecurity 26 | 27 | NSAllowsArbitraryLoadsInWebContent 28 | 29 | 30 | NSMainNibFile 31 | MainMenu 32 | NSPrincipalClass 33 | NSApplication 34 | 35 | 36 | -------------------------------------------------------------------------------- /OMCTestApp/Introduction.qtz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/OMCTestApp/Introduction.qtz -------------------------------------------------------------------------------- /OMCTestApp/Ls Browser.omc/Contents/Resources/English.lproj/Browser.nib/keyedobjects.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/OMCTestApp/Ls Browser.omc/Contents/Resources/English.lproj/Browser.nib/keyedobjects.nib -------------------------------------------------------------------------------- /OMCTestApp/OMCTestApp.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.automation.apple-events 6 | 7 | com.apple.security.cs.disable-library-validation 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /OMCTestApp/OMCTestApp.h: -------------------------------------------------------------------------------- 1 | // 2 | // OMCTestApp.h 3 | // OMCTestApp 4 | // 5 | // Created by Tomasz Kukielka on 1/2/08. 6 | // Copyright 2008 Abracode. All rights reserved. 7 | // 8 | 9 | #import 10 | #include 11 | 12 | @interface OMCTestAppController : NSObject 13 | { 14 | OMCObserverRef mObserver; 15 | } 16 | 17 | - (IBAction)executeExampleCommand:(id)sender; 18 | - (IBAction)executeCommandWithFileContext:(id)sender; 19 | - (IBAction)executeCommandWithText:(id)sender; 20 | - (IBAction)executeExternalBundle:(id)sender; 21 | - (IBAction)executeCommandWithObserver:(id)sender; 22 | 23 | - (void)receiveObserverMessage:(OmcObserverMessage)inMessage forTaskId:(CFIndex)inTaskID withData:(CFTypeRef)inResult; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /OMCTestApp/OMCTestApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OMCTestApp/OMCTestApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /OMCTestApp/OMCTestApp_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'OMCTestApp' target in the 'OMCTestApp' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /OMCTestApp/QCDialog.qtz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/OMCTestApp/QCDialog.qtz -------------------------------------------------------------------------------- /OMCTestApp/TextContext.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | COMMAND_LIST 6 | 7 | 8 | ACTIVATION_MODE 9 | act_selected_text 10 | COMMAND 11 | 12 | tell application "System Events" 13 | set my_text to " 14 | __OBJ_TEXT__ 15 | " 16 | set paragaph_count to count paragraphs of my_text 17 | set word_count to count words of my_text 18 | set character_count to count characters of my_text 19 | set output_info to "Number of paragraphs: " & paragaph_count & return & "Number of words: " & word_count & return & "Number of characters: " & character_count & return 20 | end tell 21 | 22 | 23 | ESCAPE_SPECIAL_CHARS 24 | esc_for_applescript 25 | EXECUTION_MODE 26 | exe_applescript_with_output_window 27 | NAME 28 | 29 | Show Text Statistics 30 | 31 | NOTES 32 | Requires OMC 1.6. Shows paragraph count, word count and character count for selected text. 33 | OUTPUT_WINDOW_SETTINGS 34 | 35 | AUTO_CLOSE_ON_SUCCESS_ONLY 36 | 37 | AUTO_CLOSE_TIMEOUT 38 | -1 39 | BACKGROUND_COLOR 40 | FFFFFF 41 | TEXT_COLOR 42 | 000000 43 | TEXT_FONT 44 | Monaco 45 | TEXT_SIZE 46 | 10 47 | WINDOW_ALPHA 48 | 1 49 | WINDOW_CLOSE_FADE_OUT 50 | 51 | WINDOW_HEIGHT 52 | 200 53 | WINDOW_OPEN_FADE_IN 54 | 55 | WINDOW_POSITION 56 | alert 57 | WINDOW_TITLE 58 | Untitled 59 | WINDOW_TYPE 60 | global_floating 61 | WINDOW_WIDTH 62 | 400 63 | 64 | SEND_TASK_TO_BACKGROUND_APP 65 | 66 | REQUIRED_MAC_OS_MIN_VERSION 67 | 10.1 68 | REQUIRED_OMC_VERSION 69 | 1.3.1 70 | VERSION 71 | 1 72 | 73 | 74 | VERSION 75 | 2 76 | 77 | 78 | -------------------------------------------------------------------------------- /OMCTestApp/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/OMCTestApp/en.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /OMCTestApp/gzip.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | COMMAND_LIST 6 | 7 | 8 | ACTIVATION_MODE 9 | act_file 10 | COMMAND 11 | 12 | cd "$OMC_OBJ_PARENT_PATH"; gzip -9 -c "$OMC_OBJ_NAME" >"$OMC_OBJ_NAME.gz" 13 | 14 | EXECUTION_MODE 15 | exe_silent_popen 16 | NAME 17 | Compress with gzip 18 | NOTES 19 | Gzip reserving original 20 | REFRESH_PATH 21 | 22 | __OBJ_PATH__ 23 | .gz 24 | 25 | REQUIRED_OMC_VERSION 26 | 1.9 27 | VERSION 28 | 3 29 | 30 | 31 | VERSION 32 | 2 33 | 34 | 35 | -------------------------------------------------------------------------------- /OMCTestApp/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // OMCTestApp 4 | // 5 | // Copyright Abracode 2008. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | UInt32 GetAbracodeFrameworkVersion(void); 11 | 12 | #define MINIMUM_OMC_VERSION 20000 13 | 14 | int main(int argc, char *argv[]) 15 | { 16 | if(GetAbracodeFrameworkVersion() < MINIMUM_OMC_VERSION) 17 | return 1; 18 | 19 | return NSApplicationMain(argc, (const char **) argv); 20 | } 21 | -------------------------------------------------------------------------------- /OMCTestApp/sunflower.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/OMCTestApp/sunflower.jpg -------------------------------------------------------------------------------- /OMCTestApp/test.AppleScript.applescript: -------------------------------------------------------------------------------- 1 | set env_var to system attribute "OMC_APP_BUNDLE_PATH" 2 | -------------------------------------------------------------------------------- /OMCTestApp/test.exe.script.file.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Let's see what env variables are exported by OMC:" 4 | echo "" 5 | 6 | /usr/bin/env 7 | -------------------------------------------------------------------------------- /OMCTestApp/test.javascript.js: -------------------------------------------------------------------------------- 1 | 2 | print("Hello, World! The current local time is:", Date()); 3 | -------------------------------------------------------------------------------- /OMCTestApp/test.webkit.example.client.js: -------------------------------------------------------------------------------- 1 | // This is an injected client-side JavaScript 2 | // It is associated with OMCWebKitView instance by setting "User Defined Runtime Attributes" in nib control: 3 | // javaScriptFile=test.webkit.example.client 4 | // This code is executed by WebKit after HTML document is loaded 5 | 6 | function changeBackgroundColor(inColor) 7 | { 8 | document.body.style.backgroundColor = inColor; 9 | } 10 | 11 | changeBackgroundColor("teal"); 12 | 13 | // OMC injects OMCWebKitSupport.js before document load and adds OMC APIs: 14 | // OMC.getAllElementValues() 15 | // OMC.getAllElementIDs() 16 | // OMC.registerElementByID(elementID) 17 | // OMC.registerElement(element, newID) 18 | // OMC.execute(commandID, senderElementID) 19 | 20 | // If you don't control the HTML to assign class="OMC" to elements, you can register them dynamically 21 | // Registering elements with OMC makes their values visible as env variables in executed scripts in form: 22 | // OMC_NIB_WEBVIEW_N_ELEMENT_XYZ_VALUE 23 | // where N is OMCWebKitView control tag/id in nib dialog and 24 | // XYZ is HTML element ID, normalized by capitalization and replacing non-alphanumeric characters with _ 25 | // for example OMC_NIB_WEBVIEW_2_ELEMENT_ONE_VALUE below 26 | 27 | OMC.registerElementByID("one"); 28 | OMC.registerElementByID("two"); 29 | 30 | // Now register an element without an initial id in HTML 31 | // OMC requires IDs for elements to get their values 32 | // so when you call OMC.registerElement(element, newID) 33 | // you are assigning a new ID, potentially overwriting an existing one 34 | // this of course might have unexpected side effects if some other code relies on previous ID 35 | let depthElems = document.getElementsByClassName("depth"); 36 | if(depthElems.length == 1) 37 | { 38 | OMC.registerElement(depthElems[0], "three"); 39 | } 40 | 41 | // Add event listener to elements to execute an OMC command on native side 42 | // any element can trigegr commands that way, it does not need to be of class OMC 43 | function excuteOMCCommandOnClick() 44 | { 45 | const commandID = "test.webkitview.clicked"; 46 | let senderElementID = this.id; 47 | OMC.execute(commandID, senderElementID); 48 | } 49 | 50 | let elementFireCheckbox = document.getElementById("fire"); 51 | elementFireCheckbox.addEventListener("click", excuteOMCCommandOnClick, false); 52 | 53 | let elementTwo = document.getElementById("two"); 54 | elementTwo.addEventListener("dblclick", excuteOMCCommandOnClick, false); 55 | 56 | // This one has the id dynamically assigned by OMC.registerElement() 57 | // so let's test if we can actually find it by its new id 58 | let elementThree = document.getElementById("three"); 59 | elementThree.addEventListener("mouseup", excuteOMCCommandOnClick, false); 60 | 61 | -------------------------------------------------------------------------------- /OMCTestApp/test.webkit.example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | 13 |

Email:

14 |

Password:

15 |

Checkbox:

16 |

Elements:

17 |

18 | Earth
19 | Air
20 | Fire [registers click event]
21 | Water
22 |

23 |
24 | 25 | 26 |
27 |

Element with class="length" and id=one, initially not registered with OMC

28 |
29 | 30 |
31 |

Element with class="width" and id=two. Executes command on double click

32 |
33 | 34 |
35 |

Element with class="depth" and no initial id. Client JS code assigns id=three and registers mouseup event

36 |
37 | 38 | 39 | 40 | 41 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /OMCTestApp/test.webkitview.clicked.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | "$OMC_OMC_SUPPORT_PATH/alert" --title "Clicked" --ok "OK" "Element with registered event handler was clicked" 4 | -------------------------------------------------------------------------------- /OMCTestApp/test.webkitview.execute.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | env | sort | grep "OMC_" 4 | 5 | "$OMC_OMC_SUPPORT_PATH/alert" --title "Hello from HTML Button" --ok "OK" "This command has been triggered by JavaScript in WKWebView and executed in shell script" 6 | -------------------------------------------------------------------------------- /OMCTestApp/test.webkitview.init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | "$OMC_OMC_SUPPORT_PATH/omc_dialog_control" "$OMC_NIB_DLG_GUID" 1 "file://$OMC_APP_BUNDLE_PATH/Contents/Resources/test.webkit.example.html" 4 | "$OMC_OMC_SUPPORT_PATH/omc_dialog_control" "$OMC_NIB_DLG_GUID" 2 "file://$OMC_APP_BUNDLE_PATH/Contents/Resources/test.webkit.example.html" 5 | 6 | # "$OMC_OMC_SUPPORT_PATH/omc_dialog_control" "$OMC_NIB_DLG_GUID" 1 "http://abracode.com" 7 | # "$OMC_OMC_SUPPORT_PATH/omc_dialog_control" "$OMC_NIB_DLG_GUID" 2 "http://abracode.com" 8 | -------------------------------------------------------------------------------- /OMCTestApp/test.webkitview.set.url.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | new_url="$OMC_NIB_DIALOG_CONTROL_1_VALUE" 4 | "$OMC_OMC_SUPPORT_PATH/omc_dialog_control" "$OMC_NIB_DLG_GUID" 2 "$new_url" 5 | -------------------------------------------------------------------------------- /OnMyCommandCM/Icon.rsrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/OnMyCommandCM/Icon.rsrc -------------------------------------------------------------------------------- /OnMyCommandCM/Info-OnMyCommandCM.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | OnMyCommandCM 9 | CFBundleGetInfoString 10 | OnMyCommandCM version ${OMC_BUNDLE_VERSION} 11 | CFBundleIdentifier 12 | ${PRODUCT_BUNDLE_IDENTIFIER} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleLongVersionString 16 | OnMyCommandCM version ${OMC_BUNDLE_VERSION}, Copyright Abracode 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | cmpi 21 | CFBundleIconFile 22 | app.icns 23 | CFBundleShortVersionString 24 | ${OMC_BUNDLE_VERSION} 25 | CFBundleSignature 26 | cmnu 27 | CFBundleVersion 28 | ${OMC_BUNDLE_VERSION} 29 | CFPlugInDynamicRegisterFunction 30 | 31 | CFPlugInDynamicRegistration 32 | NO 33 | CFPlugInFactories 34 | 35 | CDA548CA-C6E5-11D6-8221-003065EAE3BE 36 | ACMPluginFactory 37 | 38 | CFPlugInTypes 39 | 40 | 2F6522E9-3E66-11D5-80A7-003065B300BC 41 | 42 | CDA548CA-C6E5-11D6-8221-003065EAE3BE 43 | 44 | 45 | CFPlugInUnloadFunction 46 | 47 | NSHumanReadableCopyright 48 | Copyright Abracode 49 | 50 | 51 | -------------------------------------------------------------------------------- /OnMyCommandCM/OnMyCommandCM.cp: -------------------------------------------------------------------------------- 1 | //************************************************************************************** 2 | // Filename: OnMyCommandCM.cp 3 | // Part of Contextual Menu Workshop by Abracode Inc. 4 | // http://free.abracode.com/cmworkshop/ 5 | // Copyright � 2002-2005 Abracode, Inc. All rights reserved. 6 | // 7 | // Description: Executes Unix commands in Terminal.app or silently 8 | // 9 | //************************************************************************************** 10 | 11 | 12 | #include "OnMyCommand.h" 13 | 14 | #pragma mark - 15 | #pragma mark **** IMPLEMENTATION **** 16 | 17 | CFUUIDRef kCMPluginFactoryID = ::CFUUIDGetConstantUUIDWithBytes( NULL, 18 | 0xCD, 0xA5, 0x48, 0xCA, 0xC6, 0xE5, 0x11, 0xD6, 0x82, 0x21, 0x00, 0x30, 0x65, 0xEA, 0xE3, 0xBE ); 19 | // "CDA548CA-C6E5-11D6-8221-003065EAE3BE" 20 | 21 | ACMPlugin *CreateNewCMPlugin() 22 | { 23 | // TRACE_CSTR( "CreateNewCMPlugin for OnMyCommandCM\n" ); 24 | return new OnMyCommandCM(NULL); 25 | } 26 | 27 | -------------------------------------------------------------------------------- /OnMyCommandCM/OnMyCommandCM.exp: -------------------------------------------------------------------------------- 1 | _ACMPluginFactory 2 | -------------------------------------------------------------------------------- /OnMyCommandCM/OnMyCommandCM.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OnMyCommandCM/OnMyCommandCM.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /OnMyCommandCM/app.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abra-code/OMC/8e86aed52ccfccfa2f064f125825b1ed8428b70a/OnMyCommandCM/app.icns -------------------------------------------------------------------------------- /alert--help.md: -------------------------------------------------------------------------------- 1 | ./alert --help 2 | 3 | ``` 4 | NAME 5 | alert - display GUI alert dialog 6 | 7 | SYNOPSIS 8 | alert [options] "Alert Message" 9 | 10 | DESCRIPTION 11 | alert presents a dialog for user to respond 12 | It waits until one of the buttons is hit or it times out 13 | 14 | OPTIONS 15 | -h,--help 16 | Print this help and exit 17 | -t,--title 18 | Alert title string. "Alert" is default if not specified 19 | -b0,--ok 20 | Default button string. "OK" is default if not specified 21 | -b1,--cancel 22 | Cancel button string. Cancel button is not shown if this string 23 | is not specified 24 | -b2,--other 25 | Other button string. Other button is not shown if this string 26 | is not specified 27 | -o,--timeout 28 | Timeout in seconds. The dialog will be dismissed after 29 | specified number of seconds. 30 | By default the dialog never times out (timeout = 0) 31 | -l,--level 32 | Specify alert level. Each level uses different icon. 33 | Allowed values are: 34 | plain (default if not specified) 35 | stop 36 | note 37 | caution 38 | 39 | RETURN VALUES 40 | The alert utility exits with one of the following values: 41 | 0 - user pressed OK button 42 | 1 - user pressed Cancel button 43 | 2 - user pressed Other button 44 | 3 - dialog timed out 45 | -1 - an error occurred 46 | 47 | EXAMPLES 48 | alert --level caution --timeout 10 --title "Warning" --ok "Continue" --cancel "Cancel" "Do you wish to continue?" 49 | result=$? 50 | if test $result -ne 0; then echo "Cancelled"; exit 1; fi; 51 | ``` 52 | -------------------------------------------------------------------------------- /alert/alert.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /alert/alert.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /b64--help.md: -------------------------------------------------------------------------------- 1 | ./b64 --help 2 | 3 | ``` 4 | usage: b64 encode|decode string|file|stdin path/to/file|string|stdin [output path/to/output/file] 5 | ``` 6 | 7 | -------------------------------------------------------------------------------- /b64/ABase64.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ABase64.h 3 | * b64 4 | * 5 | * Created by Tomasz Kukielka on 12/7/05. 6 | * Copyright 2005 Abracode. All rights reserved. 7 | * 8 | */ 9 | 10 | #pragma once 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | unsigned long CalculateEncodedBufferSize(unsigned long inRawDataLen); 17 | unsigned long CalculateDecodedBufferMaxSize(unsigned long inEncodedLen); 18 | 19 | unsigned long EncodeBase64(const unsigned char *inData, unsigned long inByteCount, unsigned char *outBuff, unsigned long inBuffLen); 20 | unsigned long DecodeBase64(const unsigned char *inStrBuff, unsigned long inByteCount, unsigned char *outData, unsigned long inBuffLen); 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | -------------------------------------------------------------------------------- /b64/b64.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /b64/b64.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /filt--help.md: -------------------------------------------------------------------------------- 1 | ./filt --help 2 | 3 | ``` 4 | NAME 5 | filt - lean and fast pipe filter, born out of frustration with sed 6 | 7 | SYNOPSIS 8 | filt [options] 'match reg exp' ['replace str'] 9 | 10 | DESCRIPTION 11 | filt is a pipe filter using regular expressions. 12 | Input lines matching the regular expression pattern are printed to 13 | output, transformed with replace string and taking options into account. 14 | filt works in pipe mode only: takes standard input and prints to 15 | standard output. 16 | Only modern (extended) regular expressions are allowed in match string. 17 | The replace string may refer to the whole matched string by \0 or 18 | to sub group matches by \1 thru \9. Only 9 sub groups are allowed. 19 | The replace string may contain white character escape sequences like 20 | \t, \n, \r, \\, which will be evaluated to appropriate characters in 21 | output string. 22 | 23 | OPTIONS 24 | -h,--help 25 | Print this help and exit 26 | -i,--ignore-case 27 | Regular expression matches are case-insensitive 28 | -n,--not-matching 29 | Only lines not matching the regular expression pattern 30 | are copied to the output 31 | With this option the replace string is ignored 32 | 33 | EXAMPLES 34 | echo "Hello World" | filt '(.+) (.+)' 'Goodbye\t\2' 35 | -> Goodbye World 36 | 37 | echo "Hello World" | filt '(.+) (.+)' '\1 \2, \1!' 38 | -> Hello World, Hello! 39 | 40 | echo "Hello World" | filt -i '[a-z]+' '\0' 41 | -> Hello 42 | 43 | printf "Hello\nWorld\n" | ./filt -n 'W.+' 44 | -> Hello 45 | 46 | SEE ALSO 47 | man re_format, man regex 48 | 49 | ``` 50 | -------------------------------------------------------------------------------- /filt/filt.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /filt/filt.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /loco--help.md: -------------------------------------------------------------------------------- 1 | ./loco 2 | 3 | ``` 4 | Usage: loco [-bundle path/to/bundle] [-table "Localizable"] "My String" 5 | 6 | ``` 7 | -------------------------------------------------------------------------------- /loco/loco.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /loco/loco.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /loco/loco.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /loco/loco_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | ${PRODUCT_BUNDLE_IDENTIFIER} 7 | CFBundleLocalizations 8 | 9 | en 10 | de 11 | fr 12 | es 13 | pt 14 | it 15 | nl 16 | da 17 | fi 18 | no 19 | el 20 | hu 21 | pl 22 | cs 23 | ru 24 | ja 25 | zh 26 | ko 27 | 28 | CFBundleName 29 | ${PRODUCT_NAME} 30 | CFBundleVersion 31 | ${OMC_BUNDLE_VERSION} 32 | LSMinimumSystemVersion 33 | ${MACOSX_DEPLOYMENT_TARGET} 34 | 35 | 36 | -------------------------------------------------------------------------------- /notify--help.md: -------------------------------------------------------------------------------- 1 | ./notify --help 2 | 3 | ``` 4 | NAME 5 | notify - send user notification 6 | 7 | SYNOPSIS 8 | notify [options] "Notification Message" 9 | 10 | DESCRIPTION 11 | notify sends user notification 12 | OPTIONS 13 | -h,--help 14 | Print this help and exit 15 | -t,--title 16 | Notification title string. "notify" is default if not specified 17 | -s,--subtitle 18 | Subtitle string 19 | -d,--sound 20 | Sound name. Use "default" or any system sound name: 21 | Basso, Blow, Bottle, Frog, Funk, Glass, Hero, Morse, Ping, Pop, Purr, Sosumi, Submarine, Tink 22 | -b,--button 23 | Button string 24 | -u,--user-info 25 | User info string 26 | EXAMPLES 27 | notify -t "My Title" -s "My Subtitle" "My Notification" 28 | ``` 29 | -------------------------------------------------------------------------------- /notify/notify.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /notify/notify.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /notify/notify.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /notify/notify/NotifyDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // NotifyDelegate.h 3 | // notify 4 | // 5 | // Created by Tomasz Kukielka on 5/17/14. 6 | // Copyright (c) 2014 Abracode. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NotifyDelegate : NSObject 12 | 13 | +(NotifyDelegate *)sharedDelegate; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /notify/notify/NotifyDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // NotifyDelegate.m 3 | // notify 4 | // 5 | // Created by Tomasz Kukielka on 5/17/14. 6 | // Copyright (c) 2014 Abracode. All rights reserved. 7 | // 8 | 9 | #import "NotifyDelegate.h" 10 | 11 | @implementation NotifyDelegate 12 | 13 | +(NotifyDelegate *)sharedDelegate 14 | { 15 | static NotifyDelegate *sSharedDelegate = nil; 16 | if(sSharedDelegate == nil) 17 | { 18 | sSharedDelegate = [[NotifyDelegate alloc] init]; 19 | NSUserNotificationCenter *defaultUserNotificationCenter = [NSUserNotificationCenter defaultUserNotificationCenter]; 20 | defaultUserNotificationCenter.delegate = sSharedDelegate; 21 | } 22 | return sSharedDelegate; 23 | } 24 | 25 | - (void)dealloc 26 | { 27 | NSUserNotificationCenter *defaultUserNotificationCenter = [NSUserNotificationCenter defaultUserNotificationCenter]; 28 | defaultUserNotificationCenter.delegate = nil; 29 | 30 | [super dealloc]; 31 | } 32 | 33 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification 34 | { 35 | NSUserNotification *activatedNotification = [aNotification.userInfo objectForKey:NSApplicationLaunchUserNotificationKey]; 36 | if(activatedNotification != nil) 37 | { 38 | NSUserNotificationCenter *userNotificationCenter = [NSUserNotificationCenter defaultUserNotificationCenter]; 39 | [self userNotificationCenter:userNotificationCenter didActivateNotification:activatedNotification]; 40 | } 41 | } 42 | 43 | - (BOOL)userNotificationCenter:(NSUserNotificationCenter *)center shouldPresentNotification:(NSUserNotification *)notification 44 | { 45 | return YES; 46 | } 47 | 48 | - (void)userNotificationCenter:(NSUserNotificationCenter *)center didDeliverNotification:(NSUserNotification *)notification 49 | { 50 | [[NSApplication sharedApplication] terminate:self]; 51 | } 52 | 53 | - (void)userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification 54 | { 55 | #pragma unused(center) 56 | if(notification.userInfo != nil) 57 | { 58 | // NSString *userInfoString = [notification.userInfo objectForKey:@"OMC_NOTIFICATION_USER_INFO"]; 59 | // NSWorkspace *sharedWorkspace = [NSWorkspace sharedWorkspace]; 60 | } 61 | 62 | NSUserNotificationCenter *defaultUserNotificationCenter = [NSUserNotificationCenter defaultUserNotificationCenter]; 63 | [defaultUserNotificationCenter removeDeliveredNotification:notification]; 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /notify/notify_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | ${PRODUCT_BUNDLE_IDENTIFIER} 7 | CFBundleName 8 | ${PRODUCT_NAME} 9 | CFBundleVersion 10 | ${OMC_BUNDLE_VERSION} 11 | LSMinimumSystemVersion 12 | ${MACOSX_DEPLOYMENT_TARGET} 13 | NSPrincipalClass 14 | NSApplication 15 | NSUserNotificationAlertStyle 16 | alert 17 | 18 | 19 | -------------------------------------------------------------------------------- /omc_controls_user_defined_runtime_attributes.md: -------------------------------------------------------------------------------- 1 | OMC Controls Custom Properties 2 | The following custom properties are supported by OMC controls to put in “User Defined Runtime Attributes” in “Identity” inspector in Xcode. 3 | 4 | ``` 5 | The strings below are for columns: 6 | “Type” “Key Path” 7 | 8 | OMCBox: 9 | Number tag 10 | 11 | OMCButton: 12 | String commandID 13 | String mappedOnValue 14 | String mappedOffValue 15 | String escapingMode 16 | Boolean acceptFileDrop 17 | Boolean acceptTextDrop 18 | 19 | OMCButtonCell: 20 | String commandID 21 | String mappedOnValue 22 | String mappedOffValue 23 | String escapingMode 24 | 25 | OMCComboBox: 26 | String commandID 27 | String escapingMode 28 | 29 | OMCIKImageView: 30 | Number tag 31 | String escapingMode 32 | 33 | OMCImageView: 34 | String commandID 35 | String escapingMode 36 | 37 | OMCMenuItem: 38 | String commandID 39 | String mappedValue 40 | String escapingMode 41 | 42 | OMCPDFView: 43 | Number tag 44 | String escapingMode 45 | 46 | OMCPopUpButton: 47 | String commandID 48 | 49 | OMCProgressIndicator: 50 | Number tag 51 | 52 | OMCQCView: 53 | String commandID 54 | Number tag 55 | String escapingMode 56 | 57 | OMCQTMovieView: 58 | Number tag 59 | String escapingMode 60 | 61 | OMCSearchField: 62 | String commandID 63 | String escapingMode 64 | 65 | OMCSecureTextField: 66 | String commandID 67 | String escapingMode 68 | 69 | OMCSlider: 70 | String commandID 71 | 72 | OMCTableView: 73 | String selectionCommandID 74 | String doubleClickCommandID 75 | String combinedSelectionPrefix 76 | String combinedSelectionSuffix 77 | String combinedSelectionSeparator 78 | String multipleColumnPrefix 79 | String multipleColumnSuffix 80 | String multipleColumnSeparator 81 | String escapingMode 82 | 83 | OMCTextField: 84 | String commandID 85 | String escapingMode 86 | 87 | OMCTextView: 88 | Number tag 89 | String escapingMode 90 | 91 | OMCTextView: 92 | Number tag 93 | String escapingMode 94 | 95 | OMCView: 96 | Number tag 97 | 98 | OMCWebView: 99 | Number tag 100 | String escapingMode 101 | 102 | 103 | escapingMode predefined strings: 104 | esc_none 105 | esc_with_backslash 106 | esc_with_percent 107 | esc_with_percent_all 108 | esc_for_applescript 109 | esc_wrap_with_single_quotes_for_shell 110 | 111 | ``` 112 | -------------------------------------------------------------------------------- /omc_dialog_control/generate_app_group_identifier.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | out_file="$BUILT_PRODUCTS_DIR/generated/AppGroupIdentifier.h" 4 | echo "#pragma once\n" > "$out_file" 5 | 6 | if test -z "$DEVELOPMENT_TEAM"; then 7 | DEVELOPMENT_TEAM="group" 8 | fi 9 | 10 | echo "#define GetAppGroupIdentifier() \"$DEVELOPMENT_TEAM\"\n" >> "$out_file" 11 | 12 | -------------------------------------------------------------------------------- /omc_dialog_control/omc_dialog_control.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /omc_dialog_control/omc_dialog_control.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /omc_next_command--help.md: -------------------------------------------------------------------------------- 1 | ./omc_next_command --help 2 | 3 | ``` 4 | usage: omc_next_command __CURRENT_COMMAND_GUID__ 5 | For example: omc_next_command __CURRENT_COMMAND_GUID__ "NeXT" 6 | 7 | ``` 8 | -------------------------------------------------------------------------------- /omc_next_command/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | static char sFilePath[1024]; 7 | 8 | int main (int argc, const char * argv[]) 9 | { 10 | int result = 0; 11 | 12 | if(argc != 3) 13 | { 14 | fprintf(stderr, "usage: omc_next_command __CURRENT_COMMAND_GUID__ \nFor example: omc_next_command __CURRENT_COMMAND_GUID__ \"NeXT\"\n\n"); 15 | return -1; 16 | } 17 | 18 | const char *theNextID = argv[2]; 19 | size_t theIDLen = strlen(theNextID); 20 | if(theIDLen == 0) 21 | { 22 | fprintf(stderr, "Invalid next command ID\n"); 23 | return -1; 24 | } 25 | 26 | if( access("/tmp/OMC", F_OK|R_OK|W_OK|X_OK) != 0 ) 27 | { 28 | mkdir("/tmp/OMC", S_IRWXU|S_IRWXG|S_IRWXO); 29 | //for some reason the mkdir does not set the writable flag for group and others so do it again with chmod 30 | chmod("/tmp/OMC", S_IRWXU|S_IRWXG|S_IRWXO); 31 | } 32 | 33 | snprintf(sFilePath, sizeof(sFilePath), "/tmp/OMC/%s.id", argv[1]); 34 | 35 | FILE *fp = fopen(sFilePath, "w"); 36 | if(fp != NULL) 37 | { 38 | size_t writtenObjects = fwrite(theNextID, theIDLen, 1, fp); 39 | if(writtenObjects != 1) 40 | { 41 | fprintf(stderr, "an error occurred while writing next command id to file: %s\n", sFilePath); 42 | result = -1; 43 | } 44 | fclose(fp); 45 | } 46 | 47 | return result; 48 | } 49 | -------------------------------------------------------------------------------- /omc_next_command/omc_next_command.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /omc_next_command/omc_next_command.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /pasteboard--help.md: -------------------------------------------------------------------------------- 1 | ./pasteboard --help 2 | 3 | ``` 4 | NAME 5 | pasteboard - set or get Mac OS X pasteboard string 6 | 7 | SYNOPSIS 8 | pasteboard "Pasteboard Name" put[set]|get "String To Set" 9 | 10 | DESCRIPTION 11 | pasteboard allows you set or get a string in Mac OS X pasteboard 12 | It supports private (named) pasteboards as well as global "general" and "find" pasteboards 13 | It can be used for interprocess communication through private pasteboards 14 | You can use either "put" or "set" command for putting the string in the pasteboard 15 | ``` 16 | -------------------------------------------------------------------------------- /pasteboard/pasteboard.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /pasteboard/pasteboard.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /plister--help.md: -------------------------------------------------------------------------------- 1 | ./pasteboard --help 2 | 3 | ``` 4 | Usage: plister command command_params path/to/plist/file plist/property/pseudopath 5 | Available commands: get, set, remove|delete, add|append, insert, find, findall, iterate 6 | "insert" command is for dict or array and must be followed key or index respectively 7 | "set" command is for replacing existing value with new value 8 | "add"|"append" command is for array only 9 | "find", "findall" and "iterate" commands are for containers only (dict or array) 10 | "iterate" syntax: plister iterate [path/to/file.plist] /path/to/container command command_params subpath/to/item 11 | 12 | Available params for "get": type, key, keys, value, string, count 13 | Available parameter types for "find" and "findall": string, integer, real, bool 14 | Available parameter types for "set", "add", "insert": string, integer, real, bool, date, data, dict, array, copy 15 | Parameter types: string, integer, real, bool, date, data must be followed by an appropriate value 16 | "data" must be followed by Base64 encoded string 17 | "dict" and "array" are used for creating new empty containers and must not be followed any value 18 | "copy" is a special directive which must be followed by source/file/path source/property/pseudopath 19 | 20 | "find" and "findall" commands may use a sub-item pseudopath as the last parameter 21 | to specify a container item-relative path which points to something inside that item for matching: 22 | plister find string "Item" file.plist /path/to/container subpath/to/item 23 | It is needed because item in searched container may be a container itself and we need a simple type as a match criteria. 24 | When searching array, found item index is returned, for dictionary: found item key is returned 25 | "find" returns only the first match while "findall" returns all matches. If no matching items are found, empty string is returned. 26 | 27 | Examples: 28 | Start by creating a new plist file with dictionary as a root container: 29 | plister set dict example.plist / 30 | plister insert "VERSION" integer 1 example.plist / 31 | plister get value example.plist /VERSION 32 | plister set integer 2 example.plist /VERSION 33 | plister insert "NewArray" array example.plist / 34 | plister add integer 10 example.plist /NewArray 35 | plister append integer 20 example.plist /NewArray 36 | plister get count example.plist /NewArray 37 | plister get type example.plist /NewArray/0 38 | plister get value example.plist /NewArray/1 39 | plister remove example.plist /NewArray/1 40 | plister insert "NewDict" dict example.plist / 41 | plister insert "New Key" string "New Value" example.plist /NewDict 42 | plister get keys example.plist /NewDict 43 | Now create new.plist and copy "NewArray" from example.plist: 44 | plister set dict new.plist / 45 | plister insert "DuplicateArray" copy example.plist /NewArray new.plist / 46 | 47 | Find a command named "Touch File" in COMMAND_LIST array in OMC plist: 48 | plister find string "Touch File" Command.plist /COMMAND_LIST /NAME 49 | 50 | plister iterate example.plist /NewArray get string / 51 | 52 | ``` 53 | -------------------------------------------------------------------------------- /plister/0.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | COMMAND_LIST 6 | 7 | 8 | ACTIVATION_MODE 9 | act_selected_text 10 | CATEGORIES 11 | 12 | Web 13 | 14 | COMMAND 15 | 16 | open 17 | http://www.fedex.com/cgi-bin/tracking?action=track\& 18 | language=english\&last_action=alttrack\&ascend_header=1\& 19 | cntry_code=\&initial=x\&mps=y\&tracknumbers= 20 | __OBJ_TEXT__ 21 | 22 | ESCAPE_SPECIAL_CHARS 23 | esc_with_percent 24 | EXECUTION_MODE 25 | exe_silent_popen 26 | NAME 27 | FedEx Track 28 | NOTES 29 | Hi. 30 | OUTPUT_WINDOW_SETTINGS 31 | 32 | REQUIRED_MAC_OS_MIN_VERSION 33 | 10.1 34 | REQUIRED_OMC_VERSION 35 | 1.3.1 36 | SUBMENU_NAME 37 | .. 38 | VERSION 39 | 1 40 | 41 | 42 | MyData 43 | 44 | QURQIEdtYkggQW5hbHlzZSBEZXNpZ24gJiBQcm9ncmFtbWllcnVuZyBHZXNlbGxzY2hh 45 | ZnQgbWl0IGJlc2NocmFua3RlciBIYWZ0dW5n 46 | 47 | hello2 48 | myk 49 | mykey-copied 50 | hello2 51 | mykey2 52 | hello2 53 | strings 54 | 55 | string1 56 | string2 57 | string3 58 | 59 | whatsup 60 | Wassup 61 | 62 | 63 | -------------------------------------------------------------------------------- /plister/plister.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /plister/plister.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | --------------------------------------------------------------------------------