Old files for reference to help with AppleScript and related.

This commit is contained in:
Scott Idem
2026-04-20 17:02:46 -04:00
parent 002c27e73c
commit 5b59dbc2da
33 changed files with 1870 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,567 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
3C278DA7225CF5C6004FFC53 /* masterkey.app in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3C41339F2227E09B0041136E /* masterkey.app */; };
3C39A72F2267ABA90061367B /* WordMacAssistant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C39A72E2267ABA90061367B /* WordMacAssistant.swift */; };
3C39A7312267ACCF0061367B /* AcrobatWindowsAssistant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C39A7302267ACCF0061367B /* AcrobatWindowsAssistant.swift */; };
3C39A7332267ACF60061367B /* Windows Application Names in Resources */ = {isa = PBXBuildFile; fileRef = 3C39A7322267ACF60061367B /* Windows Application Names */; };
3C39A7352267AF040061367B /* WindowsVideoAssistant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C39A7342267AF040061367B /* WindowsVideoAssistant.swift */; };
3C39A739226A347A0061367B /* ExcelAssistant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C39A738226A347A0061367B /* ExcelAssistant.swift */; };
3C4133A32227E09B0041136E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C4133A22227E09B0041136E /* AppDelegate.swift */; };
3C4133A52227E09F0041136E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3C4133A42227E09F0041136E /* Assets.xcassets */; };
3C4133A82227E09F0041136E /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3C4133A62227E09F0041136E /* MainMenu.xib */; };
3C4133B42227E09F0041136E /* masterkeyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C4133B32227E09F0041136E /* masterkeyTests.swift */; };
3C4133C02227E1B70041136E /* PowerPointMacAssistant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C4133BF2227E1B70041136E /* PowerPointMacAssistant.swift */; };
3C4133C22227E1C90041136E /* PowerPointWindowsAssistant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C4133C12227E1C90041136E /* PowerPointWindowsAssistant.swift */; };
3C4133C42227E1D60041136E /* KeynoteAssistant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C4133C32227E1D60041136E /* KeynoteAssistant.swift */; };
3C4133C62227E1E50041136E /* LegacyKeynoteAssistant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C4133C52227E1E40041136E /* LegacyKeynoteAssistant.swift */; };
3C4133C82227E2010041136E /* AcrobatAssistant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C4133C72227E2010041136E /* AcrobatAssistant.swift */; };
3C4133CA2227E2960041136E /* ApplicationAssistant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C4133C92227E2960041136E /* ApplicationAssistant.swift */; };
3C88C06A225DADDD0048E01A /* VideoAssistant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C88C069225DADDD0048E01A /* VideoAssistant.swift */; };
3CE21AD62259B3EE00F666B9 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CE21AD52259B3EE00F666B9 /* Utilities.swift */; };
3CE21AD92259B4A000F666B9 /* LegacyUtilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CE21AD82259B4A000F666B9 /* LegacyUtilities.m */; };
3CE21ADC225A674800F666B9 /* LibreOfficeAssistant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3CE21ADB225A674800F666B9 /* LibreOfficeAssistant.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
3C4133B02227E09F0041136E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 3C4133972227E09B0041136E /* Project object */;
proxyType = 1;
remoteGlobalIDString = 3C41339E2227E09B0041136E;
remoteInfo = masterkey;
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
3CE0D699224155AE00E7FC1C /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /Users/Ian/Desktop;
dstSubfolderSpec = 0;
files = (
3C278DA7225CF5C6004FFC53 /* masterkey.app in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
3C39A72E2267ABA90061367B /* WordMacAssistant.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WordMacAssistant.swift; sourceTree = "<group>"; };
3C39A7302267ACCF0061367B /* AcrobatWindowsAssistant.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AcrobatWindowsAssistant.swift; sourceTree = "<group>"; };
3C39A7322267ACF60061367B /* Windows Application Names */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Windows Application Names"; sourceTree = "<group>"; };
3C39A7342267AF040061367B /* WindowsVideoAssistant.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WindowsVideoAssistant.swift; sourceTree = "<group>"; };
3C39A738226A347A0061367B /* ExcelAssistant.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExcelAssistant.swift; sourceTree = "<group>"; };
3C41339F2227E09B0041136E /* masterkey.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = masterkey.app; sourceTree = BUILT_PRODUCTS_DIR; };
3C4133A22227E09B0041136E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
3C4133A42227E09F0041136E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
3C4133A72227E09F0041136E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
3C4133A92227E09F0041136E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3C4133AA2227E09F0041136E /* masterkey.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = masterkey.entitlements; sourceTree = "<group>"; };
3C4133AF2227E09F0041136E /* masterkeyTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = masterkeyTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3C4133B32227E09F0041136E /* masterkeyTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = masterkeyTests.swift; sourceTree = "<group>"; };
3C4133B52227E09F0041136E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3C4133BF2227E1B70041136E /* PowerPointMacAssistant.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PowerPointMacAssistant.swift; sourceTree = "<group>"; };
3C4133C12227E1C90041136E /* PowerPointWindowsAssistant.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PowerPointWindowsAssistant.swift; sourceTree = "<group>"; };
3C4133C32227E1D60041136E /* KeynoteAssistant.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeynoteAssistant.swift; sourceTree = "<group>"; };
3C4133C52227E1E40041136E /* LegacyKeynoteAssistant.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegacyKeynoteAssistant.swift; sourceTree = "<group>"; };
3C4133C72227E2010041136E /* AcrobatAssistant.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AcrobatAssistant.swift; sourceTree = "<group>"; };
3C4133C92227E2960041136E /* ApplicationAssistant.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplicationAssistant.swift; sourceTree = "<group>"; };
3C88C069225DADDD0048E01A /* VideoAssistant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoAssistant.swift; sourceTree = "<group>"; };
3CE21AD52259B3EE00F666B9 /* Utilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utilities.swift; sourceTree = "<group>"; };
3CE21AD72259B4A000F666B9 /* masterkey-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "masterkey-Bridging-Header.h"; sourceTree = "<group>"; };
3CE21AD82259B4A000F666B9 /* LegacyUtilities.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LegacyUtilities.m; sourceTree = "<group>"; };
3CE21ADA2259B5B900F666B9 /* LegacyUtilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LegacyUtilities.h; sourceTree = "<group>"; };
3CE21ADB225A674800F666B9 /* LibreOfficeAssistant.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibreOfficeAssistant.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
3C41339C2227E09B0041136E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
3C4133AC2227E09F0041136E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
3C4133962227E09B0041136E = {
isa = PBXGroup;
children = (
3C4133A12227E09B0041136E /* masterkey */,
3C4133B22227E09F0041136E /* masterkeyTests */,
3C4133A02227E09B0041136E /* Products */,
);
sourceTree = "<group>";
};
3C4133A02227E09B0041136E /* Products */ = {
isa = PBXGroup;
children = (
3C41339F2227E09B0041136E /* masterkey.app */,
3C4133AF2227E09F0041136E /* masterkeyTests.xctest */,
);
name = Products;
sourceTree = "<group>";
};
3C4133A12227E09B0041136E /* masterkey */ = {
isa = PBXGroup;
children = (
3C4133BE2227E0B90041136E /* ApplicationAssistants */,
3C4133C92227E2960041136E /* ApplicationAssistant.swift */,
3C4133A22227E09B0041136E /* AppDelegate.swift */,
3C4133A42227E09F0041136E /* Assets.xcassets */,
3C4133A62227E09F0041136E /* MainMenu.xib */,
3C4133A92227E09F0041136E /* Info.plist */,
3C4133AA2227E09F0041136E /* masterkey.entitlements */,
3CE21AD52259B3EE00F666B9 /* Utilities.swift */,
3CE21ADA2259B5B900F666B9 /* LegacyUtilities.h */,
3CE21AD82259B4A000F666B9 /* LegacyUtilities.m */,
3CE21AD72259B4A000F666B9 /* masterkey-Bridging-Header.h */,
3C39A7322267ACF60061367B /* Windows Application Names */,
);
path = masterkey;
sourceTree = "<group>";
};
3C4133B22227E09F0041136E /* masterkeyTests */ = {
isa = PBXGroup;
children = (
3C4133B32227E09F0041136E /* masterkeyTests.swift */,
3C4133B52227E09F0041136E /* Info.plist */,
);
path = masterkeyTests;
sourceTree = "<group>";
};
3C4133BE2227E0B90041136E /* ApplicationAssistants */ = {
isa = PBXGroup;
children = (
3C4133BF2227E1B70041136E /* PowerPointMacAssistant.swift */,
3C4133C12227E1C90041136E /* PowerPointWindowsAssistant.swift */,
3C39A72E2267ABA90061367B /* WordMacAssistant.swift */,
3C4133C32227E1D60041136E /* KeynoteAssistant.swift */,
3C4133C52227E1E40041136E /* LegacyKeynoteAssistant.swift */,
3C4133C72227E2010041136E /* AcrobatAssistant.swift */,
3C39A7302267ACCF0061367B /* AcrobatWindowsAssistant.swift */,
3CE21ADB225A674800F666B9 /* LibreOfficeAssistant.swift */,
3C88C069225DADDD0048E01A /* VideoAssistant.swift */,
3C39A7342267AF040061367B /* WindowsVideoAssistant.swift */,
3C39A738226A347A0061367B /* ExcelAssistant.swift */,
);
path = ApplicationAssistants;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
3C41339E2227E09B0041136E /* masterkey */ = {
isa = PBXNativeTarget;
buildConfigurationList = 3C4133B82227E09F0041136E /* Build configuration list for PBXNativeTarget "masterkey" */;
buildPhases = (
3C41339B2227E09B0041136E /* Sources */,
3C41339C2227E09B0041136E /* Frameworks */,
3C41339D2227E09B0041136E /* Resources */,
3CE0D699224155AE00E7FC1C /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = masterkey;
productName = masterkey;
productReference = 3C41339F2227E09B0041136E /* masterkey.app */;
productType = "com.apple.product-type.application";
};
3C4133AE2227E09F0041136E /* masterkeyTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 3C4133BB2227E09F0041136E /* Build configuration list for PBXNativeTarget "masterkeyTests" */;
buildPhases = (
3C4133AB2227E09F0041136E /* Sources */,
3C4133AC2227E09F0041136E /* Frameworks */,
3C4133AD2227E09F0041136E /* Resources */,
);
buildRules = (
);
dependencies = (
3C4133B12227E09F0041136E /* PBXTargetDependency */,
);
name = masterkeyTests;
productName = masterkeyTests;
productReference = 3C4133AF2227E09F0041136E /* masterkeyTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
3C4133972227E09B0041136E /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1010;
LastUpgradeCheck = 1010;
ORGANIZATIONNAME = "One Sky IT";
TargetAttributes = {
3C41339E2227E09B0041136E = {
CreatedOnToolsVersion = 10.1;
LastSwiftMigration = 1020;
SystemCapabilities = {
com.apple.Sandbox = {
enabled = 0;
};
};
};
3C4133AE2227E09F0041136E = {
CreatedOnToolsVersion = 10.1;
TestTargetID = 3C41339E2227E09B0041136E;
};
};
};
buildConfigurationList = 3C41339A2227E09B0041136E /* Build configuration list for PBXProject "masterkey" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 3C4133962227E09B0041136E;
productRefGroup = 3C4133A02227E09B0041136E /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
3C41339E2227E09B0041136E /* masterkey */,
3C4133AE2227E09F0041136E /* masterkeyTests */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
3C41339D2227E09B0041136E /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3C4133A52227E09F0041136E /* Assets.xcassets in Resources */,
3C4133A82227E09F0041136E /* MainMenu.xib in Resources */,
3C39A7332267ACF60061367B /* Windows Application Names in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
3C4133AD2227E09F0041136E /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
3C41339B2227E09B0041136E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3C4133CA2227E2960041136E /* ApplicationAssistant.swift in Sources */,
3C4133C22227E1C90041136E /* PowerPointWindowsAssistant.swift in Sources */,
3C4133A32227E09B0041136E /* AppDelegate.swift in Sources */,
3C4133C42227E1D60041136E /* KeynoteAssistant.swift in Sources */,
3C39A739226A347A0061367B /* ExcelAssistant.swift in Sources */,
3C39A72F2267ABA90061367B /* WordMacAssistant.swift in Sources */,
3C4133C02227E1B70041136E /* PowerPointMacAssistant.swift in Sources */,
3CE21AD92259B4A000F666B9 /* LegacyUtilities.m in Sources */,
3C4133C62227E1E50041136E /* LegacyKeynoteAssistant.swift in Sources */,
3C39A7312267ACCF0061367B /* AcrobatWindowsAssistant.swift in Sources */,
3CE21AD62259B3EE00F666B9 /* Utilities.swift in Sources */,
3C39A7352267AF040061367B /* WindowsVideoAssistant.swift in Sources */,
3C4133C82227E2010041136E /* AcrobatAssistant.swift in Sources */,
3C88C06A225DADDD0048E01A /* VideoAssistant.swift in Sources */,
3CE21ADC225A674800F666B9 /* LibreOfficeAssistant.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
3C4133AB2227E09F0041136E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
3C4133B42227E09F0041136E /* masterkeyTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
3C4133B12227E09F0041136E /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 3C41339E2227E09B0041136E /* masterkey */;
targetProxy = 3C4133B02227E09F0041136E /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
3C4133A62227E09F0041136E /* MainMenu.xib */ = {
isa = PBXVariantGroup;
children = (
3C4133A72227E09F0041136E /* Base */,
);
name = MainMenu.xib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
3C4133B62227E09F0041136E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
3C4133B72227E09F0041136E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
CODE_SIGN_STYLE = Automatic;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
};
name = Release;
};
3C4133B92227E09F0041136E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = masterkey/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
PRODUCT_BUNDLE_IDENTIFIER = com.oneskyit.masterkey;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "masterkey/masterkey-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.2;
};
name = Debug;
};
3C4133BA2227E09F0041136E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = masterkey/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
PRODUCT_BUNDLE_IDENTIFIER = com.oneskyit.masterkey;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "masterkey/masterkey-Bridging-Header.h";
SWIFT_VERSION = 4.2;
};
name = Release;
};
3C4133BC2227E09F0041136E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = masterkeyTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.oneskyit.masterkeyTests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/masterkey.app/Contents/MacOS/masterkey";
};
name = Debug;
};
3C4133BD2227E09F0041136E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = masterkeyTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/../Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.oneskyit.masterkeyTests;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_VERSION = 4.2;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/masterkey.app/Contents/MacOS/masterkey";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
3C41339A2227E09B0041136E /* Build configuration list for PBXProject "masterkey" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3C4133B62227E09F0041136E /* Debug */,
3C4133B72227E09F0041136E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
3C4133B82227E09F0041136E /* Build configuration list for PBXNativeTarget "masterkey" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3C4133B92227E09F0041136E /* Debug */,
3C4133BA2227E09F0041136E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
3C4133BB2227E09F0041136E /* Build configuration list for PBXNativeTarget "masterkeyTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
3C4133BC2227E09F0041136E /* Debug */,
3C4133BD2227E09F0041136E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 3C4133972227E09B0041136E /* Project object */;
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:masterkey.xcodeproj">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>masterkey.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>

View File

@@ -0,0 +1,275 @@
//
// AppDelegate.swift
// masterkey
//
// Created by Ian Kohl on 2/28/19.
// Copyright © 2019 One Sky IT. All rights reserved.
//
//Open/Close
//quicktime - MP4
//Text
//Doc
import Cocoa
import OSAKit
enum ApplicationNameConstants: String {
case PowerPointMac = "Microsoft PowerPoint"
case PowerPointWin = "Microsoft Office PowerPoint"
case Keynote = "Keynote"
case LibreOffice = "LibreOffice"
case AdobeAcrobat = "Adobe Acrobat Reader DC"
case GoogleChrome = "Google Chrome"
case VLC = "VLC"
}
extension ApplicationNameConstants: CaseIterable {}
extension String {
func fileName() -> String {
return NSURL(fileURLWithPath: self).deletingPathExtension?.lastPathComponent ?? ""
}
func fileExtension() -> String {
return NSURL(fileURLWithPath: self).pathExtension ?? ""
}
}
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
var assistant:ApplicationAssistant!
var openingFile = false
//No window
//@IBOutlet weak var window: NSWindow!
func applicationDidFinishLaunching(_ aNotification: Notification) {
if !openingFile {
NSLog("Not opening a file. Displaying setup dialog...")
if setupDialog() {
NSLog("Proceeding to trigger all security warnings...")
if triggerSecurity() {
NSLog("Presentation applications have been opened..")
}
}
}
NSLog("Terminating applicaiton...")
terminateApplication()
}
func terminateApplication() {
NSLog("Terminating...")
NSApplication.shared.terminate(self)
}
func applicationWillTerminate(_ aNotification: Notification) {
}
func application(_ sender: NSApplication, openFile filename: String) -> Bool {
NSLog("Version 2.0")
openingFile = true
//Used to open a group of files
//let first_filename = filenames[0];
//open a single file
let filename_extension = String(filename.fileExtension().lowercased());
NSLog("Filename Extension: \(filename_extension)")
var assistantFlag = false
//Args to pass to application - not currently used
//var args = ""
//once we are ready with a single presentation file (lowercase, valid ext) get into the switch
switch filename_extension {
case "pptx",
"ppt",
"pptmac",
"pptxmac":
NSLog("Mac PPT File...");
assistant = PowerPointMacAssistant();
case "pptxwin",
"pptwin":
NSLog("Windows PPT File...")
assistant = PowerPointWindowsAssistant();
case "pdf",
"pdfmac":
NSLog("PDF File...")
//args = "pagemode=FullScreen"
assistant = AcrobatAssistant();
case "pdfwin":
NSLog("PDF Windows File...")
assistant = AcrobatWindowsAssistant();
case "key":
NSLog("Keynote File...")
assistant = KeynoteAssistant();
case "odp":
NSLog("LibreOffice File...")
assistant = LibreOfficeAssistant();
case "mp4",
"mkv",
"mov",
"mpeg",
"avi",
"flv",
"ogg",
"mp3",
"ogv":
NSLog("Video (VLC) File...")
assistant = VideoAssistant();
case "wmv":
NSLog("Windows Video (VLC) File...")
assistant = WindowsVideoAssistant();
case "doc",
"docx":
NSLog("Microsoft Word Document...")
assistant = WordMacAssistant();
default:
NSLog("Generic File...")
assistantFlag = true
}
let legacyUtilities: LegacyUtilities = LegacyUtilities()
if assistantFlag {
NSLog("Is assistant...")
legacyUtilities.undoMirror()
//TODO: Window to mirror
NSWorkspace.shared.openFile(filename)
} else {
if assistant.shouldUnmirror {
legacyUtilities.undoMirror()
}
NSLog("Opening file...")
NSWorkspace.shared.openFile(filename, withApplication: assistant.applicationName)
NSLog("Sleeping...")
sleep(assistant!.delay)
NSLog("Activating application...")
let apps = NSRunningApplication.runningApplications(withBundleIdentifier: assistant.bundleID)
for app in apps as [NSRunningApplication] {
if app.bundleIdentifier == assistant.bundleID {
app.activate(options: .activateIgnoringOtherApps)
}
}
NSLog("Running Automation...")
if self.runAutomation() {
NSLog("Mirror check...")
if assistant.mirrored {
NSLog("Mirroring...")
legacyUtilities.setupMirror()
}
}
}
//Start recording code
var screens = 2
//TODO: get actual number of screens as mirroring/unmirroring should be done at this point
if assistant.mirrored {
screens = 1
}
let utils = Utilities()
let rec_result = utils.startRecording(filename: filename,num_screens: screens)
NSLog("Recording result...")
NSLog(rec_result)
//End recording code
// Return true for successfully opening the file.
return true
}
//TODO: Merge this and security as it is the same code
func runAutomation() -> Bool {
NSLog("Run automation...")
NSLog(assistant.scriptString)
let script = OSAScript.init(source: assistant.scriptString, language: OSALanguage.init(forName: "JavaScript"));
var compileError : NSDictionary?
script.compileAndReturnError(&compileError)
if let compileError = compileError {
NSLog("Compile Error...")
print(compileError);
return false;
}
var scriptError : NSDictionary?
let result = script.executeAndReturnError(&scriptError)
if let scriptError = scriptError {
NSLog("Print error...")
NSLog(scriptError.description)
}
else if let result = result?.stringValue {
NSLog("Result...")
print(result)
}
return true
}
func triggerSecurity() -> Bool {
NSLog("Trigger Security...")
ApplicationNameConstants.allCases.forEach {
let application_name = $0.rawValue
let application_security_script = """
var app = Application('\(application_name)')
delay(1)
app.activate()
"""
executeSecurityScript(script: application_security_script)
}
let final_security_script = """
var finder = Application('Finder')
finder.activate()
delay(1)
var se = Application('System Events')
se.keyCode(50)
"""
NSLog(final_security_script)
executeSecurityScript(script: final_security_script)
return true
}
func executeSecurityScript(script: String) {
let script = OSAScript.init(source: script, language: OSALanguage.init(forName: "JavaScript"));
var compileError : NSDictionary?
script.compileAndReturnError(&compileError)
if let compileError = compileError {
NSLog("Security Script Compile Error...")
print(compileError);
}
var scriptError : NSDictionary?
let result = script.executeAndReturnError(&scriptError)
if let scriptError = scriptError {
NSLog("Print security script error...")
NSLog(scriptError.description)
}
else if let result = result?.stringValue {
NSLog("Trigger Security Result...")
print(result)
}
}
func setupDialog() -> Bool {
let alert = NSAlert()
alert.messageText = "Are you setting up a new version of Master Key?"
alert.informativeText = "If you answer Yes, each applicaiton (PowerPoint, Keynote, etc.) will open so that security permissions can be granted for automation for each application. If you answer no, no action will be taken and the application will exit immediately."
alert.alertStyle = .warning
alert.addButton(withTitle: "Yes")
alert.addButton(withTitle: "No")
return alert.runModal() == .alertFirstButtonReturn
}
}

View File

@@ -0,0 +1,36 @@
//
// ApplicationAssistant.swift
// masterkey
//
// Created by Ian Kohl on 2/28/19.
// Copyright © 2019 One Sky IT. All rights reserved.
//
import Foundation
class ApplicationAssistant {
var mirrored: Bool
var shouldUnmirror: Bool
var delay: UInt32
var applicationName: String
var applicationPath: String
var scriptString: String
var bundleID: String
init() {
mirrored = false
shouldUnmirror = true
delay = 0
applicationName = ""
applicationPath = ""
scriptString = """
"""
bundleID = "xxxxxxxxxxxx"
}
}

View File

@@ -0,0 +1,80 @@
//
// PowerPointMacAssistant.swift
// masterkey
//
// Created by Ian Kohl on 2/28/19.
// Copyright © 2019 One Sky IT. All rights reserved.
//
import Foundation
class AcrobatAssistant: ApplicationAssistant {
// let mirrored = false
// let delay = 3.0
// let automationType = "JavaScript" //JSX or AppleScript, osascript might not care therefore remove this
//
// let applicationName = "Microsoft PowerPoint"
//
// let applicationPath = "/Applications/Microsoft PowerPoint.app"
//
// let scriptString =
// """
// delay .5\nactivate application \"Adobe Reader\"\ntell application \"System Events\"\ntell process \"Adobe Reader\"\nclick menu item \"Cascade\" of menu 1 of menu bar item \"Window\" of menu bar 1\ndelay 1\nclick menu item \"Full Screen Mode\" of menu 1 of menu bar item \"View\" of menu bar 1\nend tell\nend tell\n
//
// se.processes['Finder'].windows[0].toolbars[0].actions['AXShowMenu'].perform()
//
//
// var se = Application('System Events')
//
// seApp.keystroke('c', { using: 'command down' }) // Press C
// delay(0.2) // adjust the delay as needed
//
// var app = Application.currentApplication()
// app.includeStandardAdditions = true
//
// var powerpoint = Application('Microsoft PowerPoint')
// powerpoint.activate()
// delay(1)
// powerpoint.activate()
// """
// osascript -l JavaScript -e 'Application("iTunes").currentTrack.name()'
override init() {
super.init()
mirrored = true
shouldUnmirror = false
delay = 2
applicationName = "Adobe Acrobat Reader DC"
applicationPath = "/Applications/Adobe Acrobat Reader DC.app"
bundleID = "com.adobe.Reader"
// tell application "Adobe Acrobat Reader DC"
// open input -- args "pagemode=FullScreen"
// activate
// end tell
// var acrobat = Application('Adobe Acrobat Reader DC')
//
// acrobat.activate()
//
// var app = Application.currentApplication()
// app.includeStandardAdditions = true
//
// acrobat.activate()
// delay(1)
// acrobat.activate()
scriptString = """
delay(1)
var se = Application('System Events')
se.keyCode(37, { using: 'command down' })
"""
}
}

View File

@@ -0,0 +1,32 @@
//
// AcrobatWindowsAssistant.swift
// masterkey
//
// Created by Ian Kohl on 4/17/19.
// Copyright © 2019 One Sky IT. All rights reserved.
//
import Foundation
class AcrobatWindowsAssistant: ApplicationAssistant {
override init() {
super.init()
mirrored = true
shouldUnmirror = false
delay = 2
applicationName = "Acrobat Reader Windows"
applicationPath = "/Applications/Acrobat Reader Windows.app"
//ctrl + l
scriptString = """
delay(1)
var se = Application('System Events')
se.keyCode(108, { using: 'control down' })
"""
}
}

View File

@@ -0,0 +1,9 @@
//
// ExcelAssistant.swift
// masterkey
//
// Created by Ian Kohl on 4/19/19.
// Copyright © 2019 One Sky IT. All rights reserved.
//
import Foundation

View File

@@ -0,0 +1,42 @@
//
// PowerPointMacAssistant.swift
// masterkey
//
// Created by Ian Kohl on 2/28/19.
// Copyright © 2019 One Sky IT. All rights reserved.
//
import Foundation
class KeynoteAssistant: ApplicationAssistant {
override init() {
super.init()
mirrored = false
shouldUnmirror = true
delay = 2
applicationName = "Keynote"
applicationPath = "/Applications/Keynote.app"
bundleID = "com.apple.iWork.Keynote"
scriptString = """
delay(1)
var keynote = Application('Keynote')
var app = Application.currentApplication()
app.includeStandardAdditions = true
keynote.activate()
delay(1)
keynote.activate()
var doc = keynote.documents[0]
var slide = doc.slides[0]
doc.start()
"""
}
}

View File

@@ -0,0 +1,60 @@
//
// PowerPointMacAssistant.swift
// masterkey
//
// Created by Ian Kohl on 2/28/19.
// Copyright © 2019 One Sky IT. All rights reserved.
//
import Foundation
class LegacyKeynoteAssistant: ApplicationAssistant {
override init() {
super.init()
mirrored = false
shouldUnmirror = true
delay = 2
applicationName = "Keynote"
applicationPath = "/Applications/iWork '09/Keynote.app"
bundleID = "com.apple.iWork.Keynote"
// delay(1)
// var keynote = Application('Keynote')
//
// var app = Application.currentApplication()
// app.includeStandardAdditions = true
//
// keynote.activate()
// delay(1)
// keynote.activate()
//
// var doc = keynote.documents[0]
// var slide = doc.slides[0]
// doc.start()
//cmd + esc
scriptString = """
delay(1)
var keynote = Application('Keynote')
var app = Application.currentApplication()
app.includeStandardAdditions = true
keynote.activate()
delay(1)
keynote.activate()
var doc = keynote.documents[0]
var slide = doc.slides[0]
doc.start()
"""
}
}

View File

@@ -0,0 +1,43 @@
//
// LibreOfficeAssistant.swift
// masterkey
//
// Created by Ian Kohl on 4/7/19.
// Copyright © 2019 One Sky IT. All rights reserved.
//
import Foundation
class LibreOfficeAssistant: ApplicationAssistant {
override init() {
super.init()
mirrored = false
shouldUnmirror = true
delay = 2
applicationName = "LibreOffice"
applicationPath = "/Applications/LibreOffice.app"
bundleID = "org.libreoffice.script"
scriptString = """
delay(1)
var lo = Application('LibreOffice')
lo.activate()
var app = Application.currentApplication()
app.includeStandardAdditions = true
lo.activate()
delay(1)
lo.activate()
var se = Application('System Events')
se.keyCode(96)
"""
}
}

View File

@@ -0,0 +1,33 @@
//
// PowerPointMacAssistant.swift
// masterkey
//
// Created by Ian Kohl on 2/28/19.
// Copyright © 2019 One Sky IT. All rights reserved.
//
import Foundation
class PowerPointMacAssistant: ApplicationAssistant {
override init() {
super.init()
mirrored = false
shouldUnmirror = true
delay = 3
applicationName = "Microsoft PowerPoint"
applicationPath = "/Applications/Microsoft PowerPoint.app"
bundleID = "com.microsoft.Powerpoint"
scriptString = """
delay(1)
var se = Application('System Events')
se.keyCode(36, { using: 'command down' })
"""
}
}

View File

@@ -0,0 +1,42 @@
//
// PowerPointMacAssistant.swift
// masterkey
//
// Created by Ian Kohl on 2/28/19.
// Copyright © 2019 One Sky IT. All rights reserved.
//
import Foundation
class PowerPointWindowsAssistant: ApplicationAssistant {
override init() {
super.init()
mirrored = false
shouldUnmirror = true
delay = 3
applicationName = "Microsoft Office PowerPoint"
applicationPath = "/Applications/Microsoft Office PowerPoint.app"
//Not overriding bundleID and keeping the superclass xxxxxxxxxxxx bundleID. Automation code handles making sure Windows PPTs are active.
scriptString = """
var powerpoint = Application('Microsoft Office PowerPoint')
var app = Application.currentApplication()
app.includeStandardAdditions = true
delay(1)
powerpoint.activate()
var se = Application('System Events')
se.keyCode(96)
delay (2)
powerpoint.activate()
"""
}
}

View File

@@ -0,0 +1,48 @@
//
// PowerPointMacAssistant.swift
// masterkey
//
// Created by Ian Kohl on 2/28/19.
// Copyright © 2019 One Sky IT. All rights reserved.
//
import Foundation
class VideoAssistant: ApplicationAssistant {
override init() {
super.init()
mirrored = true
shouldUnmirror = false
delay = 2
applicationName = "VLC"
applicationPath = "/Applications/VLC.app"
bundleID = "org.videolan.vlc"
// tell application "Adobe Acrobat Reader DC"
// open input -- args "pagemode=FullScreen"
// activate
// end tell
// var acrobat = Application('Adobe Acrobat Reader DC')
//
// acrobat.activate()
//
// var app = Application.currentApplication()
// app.includeStandardAdditions = true
//
// acrobat.activate()
// delay(1)
// acrobat.activate()
scriptString = """
delay(1)
var se = Application('System Events')
se.keyCode(3, { using: 'command down' })
"""
}
}

View File

@@ -0,0 +1,32 @@
//
// WindowsVideoAssistant.swift
// masterkey
//
// Created by Ian Kohl on 4/17/19.
// Copyright © 2019 One Sky IT. All rights reserved.
//
import Foundation
class WindowsVideoAssistant: ApplicationAssistant {
override init() {
super.init()
mirrored = true
shouldUnmirror = false
delay = 2
applicationName = "VLC Windows"
applicationPath = "/Applications/VLC Windows.app"
//alt + enter
scriptString = """
delay(1)
var se = Application('System Events')
se.keyCode(36, { using: 'option down' })
"""
}
}

View File

@@ -0,0 +1,42 @@
//
// WordMacAssistant.swift
// masterkey
//
// Created by Ian Kohl on 4/17/19.
// Copyright © 2019 One Sky IT. All rights reserved.
//
import Foundation
class WordMacAssistant: ApplicationAssistant {
override init() {
super.init()
mirrored = true
shouldUnmirror = false
delay = 3
applicationName = "Microsoft Word"
applicationPath = "/Applications/Microsoft Word.app"
bundleID = "com.microsoft.Word"
scriptString = """
var word = Application('Microsoft Word')
var app = Application.currentApplication()
app.includeStandardAdditions = true
delay(1)
word.activate()
var se = Application('System Events')
se.keyCode(53, { using: 'command down' })
delay (2)
word.activate()
"""
}
}

View File

@@ -0,0 +1,58 @@
{
"images" : [
{
"idiom" : "mac",
"size" : "16x16",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "16x16",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "32x32",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "32x32",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "128x128",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "128x128",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "256x256",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "256x256",
"scale" : "2x"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "1x"
},
{
"idiom" : "mac",
"size" : "512x512",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
<connections>
<outlet property="delegate" destination="Voe-Tx-rLC" id="GzC-gU-4Uq"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="masterkey" customModuleProvider="target"/>
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
<menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
<items>
<menuItem title="Master Key" id="1Xt-HY-uBw">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Master Key" systemMenu="apple" id="uQy-DD-JDr">
<items>
<menuItem title="About masterkey" id="5kV-Vb-QxS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="-1" id="Exp-CZ-Vem"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
<menuItem title="Services" id="NMo-om-nkz">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
</menuItem>
<menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
<menuItem title="Hide masterkey" keyEquivalent="h" id="Olw-nP-bQN">
<connections>
<action selector="hide:" target="-1" id="PnN-Uc-m68"/>
</connections>
</menuItem>
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="hideOtherApplications:" target="-1" id="VT4-aY-XCT"/>
</connections>
</menuItem>
<menuItem title="Show All" id="Kd2-mp-pUS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="unhideAllApplications:" target="-1" id="Dhg-Le-xox"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
<menuItem title="Quit masterkey" keyEquivalent="q" id="4sb-4s-VLi">
<connections>
<action selector="terminate:" target="-1" id="Te7-pn-YzF"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Help" id="wpr-3q-Mcd">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
<items>
<menuItem title="Master Key Help" keyEquivalent="?" id="FKE-Sm-Kum">
<connections>
<action selector="showHelp:" target="-1" id="y7X-2Q-9no"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
</objects>
</document>

View File

@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSAppleEventsUsageDescription</key>
<string></string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>Any File</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>public.content</string>
</array>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>pptxmac</string>
</array>
<key>CFBundleTypeName</key>
<string>OSIT PPTX Mac</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>pptxwin</string>
</array>
<key>CFBundleTypeName</key>
<string>OSIT PPTX Win</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>pptmac</string>
</array>
<key>CFBundleTypeName</key>
<string>OSIT PPT Mac</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>pptwin</string>
</array>
<key>CFBundleTypeName</key>
<string>OSIT PPT Win</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.6</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2019 One Sky IT. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

View File

@@ -0,0 +1,24 @@
//
// LegacyUtilities.h
// masterkey
//
// Created by Ian Kohl on 4/6/19.
// Copyright © 2019 One Sky IT. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#ifndef LegacyUtilities_h
#define LegacyUtilities_h
@interface LegacyUtilities: NSObject
-(void) setupMirror;
-(void) doMirror;
-(void) undoMirror;
-(void) executeMirrorAction;
@end
#endif /* LegacyUtilities_h */

View File

@@ -0,0 +1,135 @@
//
// LegacyUtilities.m
// masterkey
//
// Created by Ian Kohl on 4/6/19.
// Copyright © 2019 One Sky IT. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#include <Carbon/Carbon.h>
#import "LegacyUtilities.h"
@implementation LegacyUtilities : NSObject
-(void) setupMirror {
CGDisplayCount numberOfActiveDspys;
CGDisplayCount numberOfOnlineDspys;
CGDisplayCount numberOfTotalDspys = 2; // The number of total displays
CGDirectDisplayID activeDspys[] = {0,0};
CGDirectDisplayID onlineDspys[] = {0,0};
CGDirectDisplayID secondaryDspy;
CGDisplayErr activeError = CGGetActiveDisplayList (numberOfTotalDspys,activeDspys,&numberOfActiveDspys);
if (activeError!=0) NSLog(@"Error in obtaining active diplay list: %d\n",activeError);
CGDisplayErr onlineError = CGGetOnlineDisplayList (numberOfTotalDspys,onlineDspys,&numberOfOnlineDspys);
if (onlineError!=0) NSLog(@"Error in obtaining online diplay list: %d\n",onlineError);
CGDisplayConfigRef configRef;
CGError err = CGBeginDisplayConfiguration (&configRef);
if (err != 0) NSLog(@"Error with CGBeginDisplayConfiguration: %d\n",err);
if (numberOfOnlineDspys==2) {
if (onlineDspys[0]==CGMainDisplayID()){
secondaryDspy = onlineDspys[1];
} else {
secondaryDspy = onlineDspys[0];
}
CGDisplayConfigRef configRef;
CGError err = CGBeginDisplayConfiguration (&configRef);
if (err != 0) NSLog(@"Error with CGBeginDisplayConfiguration: %d\n",err);
if (numberOfActiveDspys==2) { // Displays are unmirrored -> mirror them
err = CGConfigureDisplayMirrorOfDisplay (configRef,secondaryDspy,CGMainDisplayID());
NSLog(@"ConfigureMirror Error: %d",err);
}
err = CGCompleteDisplayConfiguration (configRef,kCGConfigurePermanently);
NSLog(@"Mirror CompleteConfig Error: %d",err);
} else {
if (numberOfOnlineDspys>2) {
printf("Cannot handle more than 2 displays at this time. %d displays detected.\n",numberOfOnlineDspys);
} else {
printf("No secondary display detected.\n");
}
}
}
-(void) doMirror {
NSEvent *thisEvent = [NSEvent otherEventWithType:NSEventTypeSystemDefined location:CGPointMake(0,0) modifierFlags:0xa00 timestamp:0 windowNumber:0 context:0 subtype:8 data1:(NX_KEYTYPE_VIDMIRROR<<16|(0xa <<8)) data2:-1];
CGEventRef cThisEvent = [thisEvent CGEvent];
CGEventPost(0, (cThisEvent));
NSEvent *thatEvent = [NSEvent otherEventWithType:NSEventTypeSystemDefined location:NSMakePoint(0,0) modifierFlags:0xb00 timestamp:0 windowNumber:0 context:[NSGraphicsContext currentContext] subtype:8 data1:(NX_KEYTYPE_VIDMIRROR<<16|(0xb <<8)) data2:-1];
CGEventRef cThatEvent = [thatEvent CGEvent];
CGEventPost(0, (cThatEvent));
}
-(void) undoMirror {
enum MirrorMode {
off,
} mode;
mode = off;
CGDisplayCount numberOfActiveDspys;
CGDisplayCount numberOfOnlineDspys;
CGDisplayCount numberOfTotalDspys = 2;
CGDirectDisplayID activeDspys[] = {0,0};
CGDirectDisplayID onlineDspys[] = {0,0};
CGDirectDisplayID secondaryDspy;
CGDisplayErr activeError = CGGetActiveDisplayList (numberOfTotalDspys,activeDspys,&numberOfActiveDspys);
if (activeError!=0) NSLog(@"Error in obtaining active diplay list: %d\n",activeError);
CGDisplayErr onlineError = CGGetOnlineDisplayList (numberOfTotalDspys,onlineDspys,&numberOfOnlineDspys);
if (onlineError!=0) NSLog(@"Error in obtaining online diplay list: %d\n",onlineError);
if (numberOfOnlineDspys==2) { // Online displays = physical displays regardless of mirror status
if (onlineDspys[0]==CGMainDisplayID()){
secondaryDspy = onlineDspys[1];
} else {
secondaryDspy = onlineDspys[0];
}
switch (mode) {
case off:
if (numberOfActiveDspys!=2) // Active displays = software displays (mirror = 1)
[self executeMirrorAction];
break;
default:
break;
}
} else {
if (numberOfOnlineDspys>2) {
printf("Cannot handle more than 2 displays at this time. %d displays detected.\n",numberOfOnlineDspys);
} else {
printf("No secondary display detected.\n");
}
}
}
-(void) executeMirrorAction {
NSEvent *thisEvent = [NSEvent otherEventWithType:NSEventTypeSystemDefined location:CGPointMake(0,0) modifierFlags:0xa00 timestamp:0 windowNumber:0 context:0 subtype:8 data1:(NX_KEYTYPE_VIDMIRROR<<16|(0xa <<8)) data2:-1];
CGEventRef cThisEvent = [thisEvent CGEvent];
CGEventPost(0, (cThisEvent));
NSEvent *thatEvent = [NSEvent otherEventWithType:NSEventTypeSystemDefined location:NSMakePoint(0,0) modifierFlags:0xb00 timestamp:0 windowNumber:0 context:[NSGraphicsContext currentContext] subtype:8 data1:(NX_KEYTYPE_VIDMIRROR<<16|(0xb <<8)) data2:-1];
CGEventRef cThatEvent = [thatEvent CGEvent];
CGEventPost(0, (cThatEvent));
}
@end

View File

@@ -0,0 +1,41 @@
//
// Utilities.swift
// masterkey
//
// Created by Ian Kohl on 4/6/19.
// Copyright © 2019 One Sky IT. All rights reserved.
//
import Foundation
class Utilities {
func startRecording(filename: String, num_screens: Int) -> String
{
//Create output filename
let timestamp = String(NSDate().timeIntervalSince1970)
let home = NSHomeDirectory()
let recording_filename = timestamp + filename + ".mkv"
let recording_path = "\(home)/recordings/\(recording_filename)"
let device_string = "\"\(num_screens):0\""
//Get Devices
//ffmpeg -f avfoundation -list_devices true -i ""
//Start recording
//ffmpeg -f avfoundation -i "2:<audio device index>" ~/recordings/filename.mkv
let task:Process = Process()
let pipe:Pipe = Pipe()
task.launchPath = "/usr/local/bin/ffmpeg"
task.arguments = ["-f","avfoundation","-i",device_string,recording_path]
task.standardOutput = pipe
task.launch()
let handle = pipe.fileHandleForReading
let data = handle.readDataToEndOfFile()
let result_s = String(data: data, encoding: String.Encoding.utf8)!
return result_s
}
}

View File

@@ -0,0 +1,3 @@
Microsoft Office PowerPoint
VLC Windows
Acrobat Reader Windows

View File

@@ -0,0 +1,5 @@
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import "LegacyUtilities.h"

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSAppleEventsUsageDescription</key>
<string></string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View File

@@ -0,0 +1,34 @@
//
// masterkeyTests.swift
// masterkeyTests
//
// Created by Ian Kohl on 2/28/19.
// Copyright © 2019 One Sky IT. All rights reserved.
//
import XCTest
@testable import masterkey
class masterkeyTests: XCTestCase {
override func setUp() {
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}