├── .gitignore ├── Frameworks ├── AcornScripting │ ├── AcornScripting.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── AcornScripting │ │ ├── Acorn.h │ │ ├── Acorn.sdef │ │ ├── Acorn.swift │ │ ├── AcornScripting.h │ │ ├── AcornScripting.swift │ │ └── Info.plist ├── BBEditScripting │ ├── BBEditScripting.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── BBEditScripting │ │ ├── BBEdit.h │ │ ├── BBEdit.sdef │ │ ├── BBEdit.swift │ │ ├── BBEditScripting.h │ │ ├── BBEditScripting.swift │ │ └── Info.plist ├── FinderScripting │ ├── FinderScripting.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── FinderScripting │ │ ├── Finder.h │ │ ├── Finder.sdef │ │ ├── Finder.swift │ │ ├── FinderScripting.h │ │ ├── FinderScripting.swift │ │ └── Info.plist ├── IllustratorScripting │ ├── Illustrator.h │ ├── Illustrator.sdef │ ├── Illustrator.swift │ ├── IllustratorScripting.swift │ ├── IllustratorScripting.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── IllustratorScripting │ │ ├── IllustratorScripting.h │ │ └── Info.plist ├── ImageEventsScripting │ ├── ImageEventsScripting.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── ImageEventsScripting │ │ ├── ImageEvents.h │ │ ├── ImageEvents.sdef │ │ ├── ImageEvents.swift │ │ ├── ImageEventsScripting.h │ │ ├── ImageEventsScripting.swift │ │ └── Info.plist ├── MailScripting │ ├── MailScripting.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── MailScripting │ │ ├── Info.plist │ │ ├── Mail.h │ │ ├── Mail.sdef │ │ ├── Mail.swift │ │ ├── MailScripting.h │ │ └── MailScripting.swift ├── MessagesScripting │ ├── MessagesScripting.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── MessagesScripting │ │ ├── Info.plist │ │ ├── Messages.h │ │ ├── Messages.sdef │ │ ├── Messages.swift │ │ ├── MessagesScripting.h │ │ └── MessagesScripting.swift ├── PagesScripting │ ├── PagesScripting.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── PagesScripting │ │ ├── Info.plist │ │ ├── Pages.h │ │ ├── Pages.sdef │ │ ├── Pages.swift │ │ ├── PagesScripting.h │ │ └── PagesScripting.swift ├── SafariScripting │ ├── SafariScripting.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── SafariScripting │ │ ├── Info.plist │ │ ├── Safari.h │ │ ├── Safari.sdef │ │ ├── Safari.swift │ │ ├── SafariScripting.h │ │ └── SafariScripting.swift ├── ScriptingUtilities │ ├── ScriptingUtilities.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── ScriptingUtilities │ │ ├── AppUtilities.swift │ │ ├── Info.plist │ │ ├── ScriptingUtilities.h │ │ └── SundryUtilities.swift ├── SystemEventsScripting │ ├── SystemEventsScripting.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── SystemEventsScripting │ │ ├── Info.plist │ │ ├── SystemEvents.h │ │ ├── SystemEvents.sdef │ │ ├── SystemEvents.swift │ │ ├── SystemEventsScripting.h │ │ └── SystemEventsScripting.swift ├── SystemPreferencesScripting │ ├── SystemPreferencesScripting.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── SystemPreferencesScripting │ │ ├── Info.plist │ │ ├── SystemPreferences.h │ │ ├── SystemPreferences.sdef │ │ ├── SystemPreferences.swift │ │ ├── SystemPreferencesScripting.h │ │ └── SystemPreferencesScripting.swift ├── TerminalScripting │ ├── TerminalScripting.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── TerminalScripting │ │ ├── Info.plist │ │ ├── Terminal.h │ │ ├── Terminal.sdef │ │ ├── Terminal.swift │ │ ├── TerminalScripting.h │ │ └── TerminalScripting.swift ├── TextWranglerScripting │ ├── TextWranglerScripting.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── TextWranglerScripting │ │ ├── Info.plist │ │ ├── TextWrangler.h │ │ ├── TextWrangler.sdef │ │ ├── TextWrangler.swift │ │ ├── TextWranglerScripting.h │ │ └── TextWranglerScripting.swift ├── XcodeScripting │ ├── XcodeScripting.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── XcodeScripting │ │ ├── Info.plist │ │ ├── Xcode.h │ │ ├── Xcode.sdef │ │ ├── Xcode.swift │ │ ├── XcodeScripting.h │ │ └── XcodeScripting.swift ├── build.sh ├── generate.sh ├── iTunesScripting │ ├── iTunesScripting.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── iTunesScripting │ │ ├── Info.plist │ │ ├── iTunes.h │ │ ├── iTunes.sdef │ │ ├── iTunes.swift │ │ ├── iTunesScripting.h │ │ └── iTunesScripting.swift ├── install.sh └── sbhc.sh ├── README.md ├── Samples ├── Acorn │ ├── Scale and Export as PNG.swift │ └── Taunt.swift ├── BBEdit │ └── Run Script.swift ├── Image Events │ └── Scale Image by Half.swift ├── Pages │ └── Mail as PDF.swift ├── Safari │ └── OpenAppleDotCom.swift ├── Xcode │ ├── View in SourceTree.swift │ ├── Visit In Finder.swift │ ├── Visit In Terminal.swift │ └── Visit Web Repo.swift └── iTunes │ ├── LibrarySize.swift │ └── WhatsPlaying.swift ├── sbhc.py ├── sbhc_tests.py └── sbsc.py /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .DS_Store 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | *.pyc 20 | -------------------------------------------------------------------------------- /Frameworks/AcornScripting/AcornScripting.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Frameworks/AcornScripting/AcornScripting/AcornScripting.h: -------------------------------------------------------------------------------- 1 | // 2 | // AcornScripting.h 3 | // AcornScripting 4 | // 5 | // Copyright (c) 2015 Majesty Software. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import 26 | 27 | //! Project version number for AcornScripting. 28 | FOUNDATION_EXPORT double AcornScriptingVersionNumber; 29 | 30 | //! Project version string for AcornScripting. 31 | FOUNDATION_EXPORT const unsigned char AcornScriptingVersionString[]; 32 | 33 | // In this header, you should import all the public headers of your framework using statements like #import 34 | -------------------------------------------------------------------------------- /Frameworks/AcornScripting/AcornScripting/AcornScripting.swift: -------------------------------------------------------------------------------- 1 | public enum AcornScripting: String { 2 | case application = "application" 3 | case attachment = "attachment" 4 | case attributeRun = "attribute run" 5 | case bitmapLayer = "bitmap layer" 6 | case box = "box" 7 | case character = "character" 8 | case circle = "circle" 9 | case document = "document" 10 | case graphic = "graphic" 11 | case groupLayer = "group layer" 12 | case image = "image" 13 | case layer = "layer" 14 | case paragraph = "paragraph" 15 | case path = "path" 16 | case richText = "rich text" 17 | case shapeLayer = "shape layer" 18 | case textArea = "text area" 19 | case window = "window" 20 | case word = "word" 21 | } 22 | -------------------------------------------------------------------------------- /Frameworks/AcornScripting/AcornScripting/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2015 Majesty Software. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Frameworks/BBEditScripting/BBEditScripting.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Frameworks/BBEditScripting/BBEditScripting/BBEditScripting.h: -------------------------------------------------------------------------------- 1 | // 2 | // BBEditScripting.h 3 | // BBEditScripting 4 | // 5 | // Created by Tony Ingraldi on 6/20/17. 6 | // Copyright © 2017 Majesty Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for BBEditScripting. 12 | FOUNDATION_EXPORT double BBEditScriptingVersionNumber; 13 | 14 | //! Project version string for BBEditScripting. 15 | FOUNDATION_EXPORT const unsigned char BBEditScriptingVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Frameworks/BBEditScripting/BBEditScripting/BBEditScripting.swift: -------------------------------------------------------------------------------- 1 | public enum BBEditScripting: String { 2 | case compareOptions = "Compare Options" 3 | case compareResults = "Compare Results" 4 | case ftpInfo = "FTP Info" 5 | case ftpBrowserWindow = "FTP browser window" 6 | case htmlPrefs = "HTML Prefs" 7 | case markOptions = "Mark Options" 8 | case processDuplicatesOptions = "Process Duplicates Options" 9 | case processDuplicatesOutputOptions = "Process Duplicates Output Options" 10 | case processDuplicatesResults = "Process Duplicates Results" 11 | case processLinesContainingOutputOptions = "Process Lines Containing Output Options" 12 | case processLinesContainingResults = "Process Lines Containing Results" 13 | case resultEntry = "Result Entry" 14 | case searchMatch = "Search Match" 15 | case searchOptions = "Search Options" 16 | case searchStringProperties = "Search String Properties" 17 | case sortLinesOptions = "Sort Lines Options" 18 | case sortLinesOutputOptions = "Sort Lines Output Options" 19 | case application = "application" 20 | case character = "character" 21 | case clipboard = "clipboard" 22 | case differencesWindow = "differences window" 23 | case diskBrowserWindow = "disk browser window" 24 | case display_line = "display_line" 25 | case document = "document" 26 | case factoryDocument = "factory document" 27 | case factoryWindow = "factory window" 28 | case file = "file" 29 | case filter = "filter" 30 | case filter_term = "filter_term" 31 | case find_window = "find_window" 32 | case imageDocument = "image document" 33 | case imageWindow = "image window" 34 | case insertionPoint = "insertion point" 35 | case item = "item" 36 | case line = "line" 37 | case multifile_search_window = "multifile_search_window" 38 | case open_file_by_name_window = "open_file_by_name_window" 39 | case palette = "palette" 40 | case perl_reference_window = "perl_reference_window" 41 | case plugin_info_window = "plugin_info_window" 42 | case preferences_window = "preferences_window" 43 | case printSettings = "print settings" 44 | case projectCollection = "project collection" 45 | case projectDocument = "project document" 46 | case projectItem = "project item" 47 | case projectWindow = "project window" 48 | case resultsBrowser = "results browser" 49 | case scratchpadWindow = "scratchpad window" 50 | case searchResultsBrowser = "search results browser" 51 | case shellDocument = "shell document" 52 | case source_control_form_window = "source_control_form_window" 53 | case tagInfo = "tag info" 54 | case tagPairResult = "tag pair result" 55 | case tagResult = "tag result" 56 | case textDocument = "text document" 57 | case textWindow = "text window" 58 | case text = "text" 59 | case text_object = "text_object" 60 | case web_preview_window = "web_preview_window" 61 | case window = "window" 62 | case word = "word" 63 | } 64 | -------------------------------------------------------------------------------- /Frameworks/BBEditScripting/BBEditScripting/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSHumanReadableCopyright 22 | Copyright © 2017 Majesty Software. All rights reserved. 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Frameworks/FinderScripting/FinderScripting.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Frameworks/FinderScripting/FinderScripting/FinderScripting.h: -------------------------------------------------------------------------------- 1 | // 2 | // FinderScripting.h 3 | // FinderScripting 4 | // 5 | // Copyright (c) 2015 Majesty Software. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | //! Project version number for FinderScripting. 29 | FOUNDATION_EXPORT double FinderScriptingVersionNumber; 30 | 31 | //! Project version string for FinderScripting. 32 | FOUNDATION_EXPORT const unsigned char FinderScriptingVersionString[]; 33 | 34 | // In this header, you should import all the public headers of your framework using statements like #import 35 | -------------------------------------------------------------------------------- /Frameworks/FinderScripting/FinderScripting/FinderScripting.swift: -------------------------------------------------------------------------------- 1 | public enum FinderScripting: String { 2 | case finderWindow = "Finder window" 3 | case aliasFile = "alias file" 4 | case aliasList = "alias list" 5 | case applicationFile = "application file" 6 | case applicationProcess = "application process" 7 | case application = "application" 8 | case clippingWindow = "clipping window" 9 | case clipping = "clipping" 10 | case columnViewOptions = "column view options" 11 | case column = "column" 12 | case computerObject = "computer-object" 13 | case container = "container" 14 | case deskAccessoryProcess = "desk accessory process" 15 | case desktopWindow = "desktop window" 16 | case desktopObject = "desktop-object" 17 | case disk = "disk" 18 | case documentFile = "document file" 19 | case file = "file" 20 | case folder = "folder" 21 | case iconFamily = "icon family" 22 | case iconViewOptions = "icon view options" 23 | case informationWindow = "information window" 24 | case internetLocationFile = "internet location file" 25 | case item = "item" 26 | case label = "label" 27 | case listViewOptions = "list view options" 28 | case package = "package" 29 | case preferencesWindow = "preferences window" 30 | case preferences = "preferences" 31 | case process = "process" 32 | case trashObject = "trash-object" 33 | case window = "window" 34 | } 35 | -------------------------------------------------------------------------------- /Frameworks/FinderScripting/FinderScripting/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2015 Majesty Software. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Frameworks/IllustratorScripting/IllustratorScripting.swift: -------------------------------------------------------------------------------- 1 | public enum IllustratorScripting: String { 2 | case autocadExportOptions = "AutoCAD export options" 3 | case autocadOptions = "AutoCAD options" 4 | case cmykColorInfo = "CMYK color info" 5 | case epsSaveOptions = "EPS save options" 6 | case fxgSaveOptions = "FXG save options" 7 | case flashExportOptions = "Flash export options" 8 | case gifExportOptions = "GIF export options" 9 | case illustratorPreferences = "Illustrator preferences" 10 | case illustratorSaveOptions = "Illustrator save options" 11 | case jpegExportOptions = "JPEG export options" 12 | case labColorInfo = "Lab color info" 13 | case pdfExportOptions = "PDF export options" 14 | case pdfOptions = "PDF options" 15 | case pdfSaveOptions = "PDF save options" 16 | case png24ExportOptions = "PNG24 export options" 17 | case png8ExportOptions = "PNG8 export options" 18 | case ppdFile = "PPD file" 19 | case ppdProperties = "PPD properties" 20 | case photoshopExportOptions = "Photoshop export options" 21 | case photoshopOptions = "Photoshop options" 22 | case rgbColorInfo = "RGB color info" 23 | case svgExportOptions = "SVG export options" 24 | case tiffExportOptions = "TIFF export options" 25 | case add = "add" 26 | case addfromselection = "addfromselection" 27 | case application = "application" 28 | case artboard = "artboard" 29 | case artwork = "artwork" 30 | case asset = "asset" 31 | case brush = "brush" 32 | case characterStyle = "character style" 33 | case character = "character" 34 | case colorInfo = "color info" 35 | case colorManagementOptions = "color management options" 36 | case colorSeparationOptions = "color separation options" 37 | case compoundPathItem = "compound path item" 38 | case coordinateOptions = "coordinate options" 39 | case dataset = "dataset" 40 | case dimensionsInfo = "dimensions info" 41 | case documentPreset = "document preset" 42 | case document = "document" 43 | case ellipse = "ellipse" 44 | case embeddedItem = "embedded item" 45 | case flatteningOptions = "flattening options" 46 | case fontOptions = "font options" 47 | case font = "font" 48 | case gradientColorInfo = "gradient color info" 49 | case gradientStopInfo = "gradient stop info" 50 | case gradientStop = "gradient stop" 51 | case gradient = "gradient" 52 | case graphItem = "graph item" 53 | case graphicStyle = "graphic style" 54 | case grayColorInfo = "gray color info" 55 | case groupItem = "group item" 56 | case imageCaptureOptions = "image capture options" 57 | case inkProperties = "ink properties" 58 | case ink = "ink" 59 | case insertionPoint = "insertion point" 60 | case itemToExport = "item to export" 61 | case jobOptions = "job options" 62 | case layer = "layer" 63 | case legacyTextItem = "legacy text item" 64 | case line = "line" 65 | case matrix = "matrix" 66 | case meshItem = "mesh item" 67 | case noColorInfo = "no color info" 68 | case nonNativeItem = "non native item" 69 | case obsolete_properties = "obsolete_properties" 70 | case openOptions = "open options" 71 | case pageItem = "page item" 72 | case pageMarksOptions = "page marks options" 73 | case paperOptions = "paper options" 74 | case paperProperties = "paper properties" 75 | case paper = "paper" 76 | case paragraphStyle = "paragraph style" 77 | case paragraph = "paragraph" 78 | case pathItem = "path item" 79 | case pathPointInfo = "path point info" 80 | case pathPoint = "path point" 81 | case patternColorInfo = "pattern color info" 82 | case pattern = "pattern" 83 | case placedItem = "placed item" 84 | case pluginItem = "plugin item" 85 | case polygon = "polygon" 86 | case postscriptOptions = "postscript options" 87 | case printOptions = "print options" 88 | case printerProperties = "printer properties" 89 | case printer = "printer" 90 | case rasterEffectOptions = "raster effect options" 91 | case rasterItem = "raster item" 92 | case rasterizeOptions = "rasterize options" 93 | case rectangle = "rectangle" 94 | case roundedRectangle = "rounded rectangle" 95 | case screenProperties = "screen properties" 96 | case screenSpotFunction = "screen spot function" 97 | case separationScreen = "separation screen" 98 | case spotColorInfo = "spot color info" 99 | case spot = "spot" 100 | case star = "star" 101 | case story = "story" 102 | case swatch = "swatch" 103 | case swatchgroup = "swatchgroup" 104 | case symbolItem = "symbol item" 105 | case symbol = "symbol" 106 | case tabStopInfo = "tab stop info" 107 | case tag = "tag" 108 | case textFrame = "text frame" 109 | case textPath = "text path" 110 | case text = "text" 111 | case tracingobject = "tracingobject" 112 | case tracingoptions = "tracingoptions" 113 | case variable = "variable" 114 | case view = "view" 115 | case word = "word" 116 | } 117 | -------------------------------------------------------------------------------- /Frameworks/IllustratorScripting/IllustratorScripting.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Frameworks/IllustratorScripting/IllustratorScripting/IllustratorScripting.h: -------------------------------------------------------------------------------- 1 | // 2 | // IllustratorScripting.h 3 | // IllustratorScripting 4 | // 5 | // Created by Tony Ingraldi on 11/24/17. 6 | // Copyright © 2017 Majesty Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for IllustratorScripting. 12 | FOUNDATION_EXPORT double IllustratorScriptingVersionNumber; 13 | 14 | //! Project version string for IllustratorScripting. 15 | FOUNDATION_EXPORT const unsigned char IllustratorScriptingVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Frameworks/IllustratorScripting/IllustratorScripting/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSHumanReadableCopyright 22 | Copyright © 2017 Majesty Software. All rights reserved. 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Frameworks/ImageEventsScripting/ImageEventsScripting.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Frameworks/ImageEventsScripting/ImageEventsScripting/ImageEventsScripting.h: -------------------------------------------------------------------------------- 1 | // 2 | // ImageEventsScripting.h 3 | // ImageEventsScripting 4 | // 5 | // Copyright (c) 2015 Majesty Software. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | //! Project version number for ImageEventsScripting. 29 | FOUNDATION_EXPORT double ImageEventsScriptingVersionNumber; 30 | 31 | //! Project version string for ImageEventsScripting. 32 | FOUNDATION_EXPORT const unsigned char ImageEventsScriptingVersionString[]; 33 | 34 | // In this header, you should import all the public headers of your framework using statements like #import 35 | -------------------------------------------------------------------------------- /Frameworks/ImageEventsScripting/ImageEventsScripting/ImageEventsScripting.swift: -------------------------------------------------------------------------------- 1 | public enum ImageEventsScripting: String { 2 | case classicDomainObject = "Classic domain object" 3 | case alias = "alias" 4 | case application = "application" 5 | case diskItem = "disk item" 6 | case disk = "disk" 7 | case display = "display" 8 | case domain = "domain" 9 | case filePackage = "file package" 10 | case file = "file" 11 | case folder = "folder" 12 | case image = "image" 13 | case localDomainObject = "local domain object" 14 | case metadataTag = "metadata tag" 15 | case networkDomainObject = "network domain object" 16 | case profile = "profile" 17 | case systemDomainObject = "system domain object" 18 | case userDomainObject = "user domain object" 19 | } 20 | -------------------------------------------------------------------------------- /Frameworks/ImageEventsScripting/ImageEventsScripting/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2015 Majesty Software. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Frameworks/MailScripting/MailScripting.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | E6C82BF41A886B54002D55A2 /* MailScripting.h in Headers */ = {isa = PBXBuildFile; fileRef = E6C82BF31A886B54002D55A2 /* MailScripting.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | E6C82C101A886BB9002D55A2 /* Mail.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6C82C0C1A886BB9002D55A2 /* Mail.swift */; }; 12 | E6D7AE7D1AABF64500E8E744 /* MailScripting.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6D7AE7C1AABF64500E8E744 /* MailScripting.swift */; }; 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXFileReference section */ 16 | E6C82BEE1A886B54002D55A2 /* MailScripting.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MailScripting.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 17 | E6C82BF21A886B54002D55A2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 18 | E6C82BF31A886B54002D55A2 /* MailScripting.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MailScripting.h; sourceTree = ""; }; 19 | E6C82C0A1A886BB9002D55A2 /* Mail.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Mail.h; sourceTree = ""; }; 20 | E6C82C0B1A886BB9002D55A2 /* Mail.sdef */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Mail.sdef; sourceTree = ""; }; 21 | E6C82C0C1A886BB9002D55A2 /* Mail.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Mail.swift; sourceTree = ""; }; 22 | E6D7AE7C1AABF64500E8E744 /* MailScripting.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MailScripting.swift; sourceTree = ""; }; 23 | /* End PBXFileReference section */ 24 | 25 | /* Begin PBXFrameworksBuildPhase section */ 26 | E6C82BEA1A886B54002D55A2 /* Frameworks */ = { 27 | isa = PBXFrameworksBuildPhase; 28 | buildActionMask = 2147483647; 29 | files = ( 30 | ); 31 | runOnlyForDeploymentPostprocessing = 0; 32 | }; 33 | /* End PBXFrameworksBuildPhase section */ 34 | 35 | /* Begin PBXGroup section */ 36 | E6C82BE41A886B54002D55A2 = { 37 | isa = PBXGroup; 38 | children = ( 39 | E6C82BF01A886B54002D55A2 /* MailScripting */, 40 | E6C82BEF1A886B54002D55A2 /* Products */, 41 | ); 42 | sourceTree = ""; 43 | }; 44 | E6C82BEF1A886B54002D55A2 /* Products */ = { 45 | isa = PBXGroup; 46 | children = ( 47 | E6C82BEE1A886B54002D55A2 /* MailScripting.framework */, 48 | ); 49 | name = Products; 50 | sourceTree = ""; 51 | }; 52 | E6C82BF01A886B54002D55A2 /* MailScripting */ = { 53 | isa = PBXGroup; 54 | children = ( 55 | E6C82C121A886BC4002D55A2 /* ObjC Header */, 56 | E6C82BF31A886B54002D55A2 /* MailScripting.h */, 57 | E6C82C0C1A886BB9002D55A2 /* Mail.swift */, 58 | E6D7AE7C1AABF64500E8E744 /* MailScripting.swift */, 59 | E6C82BF11A886B54002D55A2 /* Supporting Files */, 60 | ); 61 | path = MailScripting; 62 | sourceTree = ""; 63 | }; 64 | E6C82BF11A886B54002D55A2 /* Supporting Files */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | E6C82BF21A886B54002D55A2 /* Info.plist */, 68 | ); 69 | name = "Supporting Files"; 70 | sourceTree = ""; 71 | }; 72 | E6C82C121A886BC4002D55A2 /* ObjC Header */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | E6C82C0A1A886BB9002D55A2 /* Mail.h */, 76 | E6C82C0B1A886BB9002D55A2 /* Mail.sdef */, 77 | ); 78 | name = "ObjC Header"; 79 | sourceTree = ""; 80 | }; 81 | /* End PBXGroup section */ 82 | 83 | /* Begin PBXHeadersBuildPhase section */ 84 | E6C82BEB1A886B54002D55A2 /* Headers */ = { 85 | isa = PBXHeadersBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | E6C82BF41A886B54002D55A2 /* MailScripting.h in Headers */, 89 | ); 90 | runOnlyForDeploymentPostprocessing = 0; 91 | }; 92 | /* End PBXHeadersBuildPhase section */ 93 | 94 | /* Begin PBXNativeTarget section */ 95 | E6C82BED1A886B54002D55A2 /* MailScripting */ = { 96 | isa = PBXNativeTarget; 97 | buildConfigurationList = E6C82C041A886B54002D55A2 /* Build configuration list for PBXNativeTarget "MailScripting" */; 98 | buildPhases = ( 99 | E6C82BE91A886B54002D55A2 /* Sources */, 100 | E6C82BEA1A886B54002D55A2 /* Frameworks */, 101 | E6C82BEB1A886B54002D55A2 /* Headers */, 102 | E6C82BEC1A886B54002D55A2 /* Resources */, 103 | ); 104 | buildRules = ( 105 | ); 106 | dependencies = ( 107 | ); 108 | name = MailScripting; 109 | productName = MailScripting; 110 | productReference = E6C82BEE1A886B54002D55A2 /* MailScripting.framework */; 111 | productType = "com.apple.product-type.framework"; 112 | }; 113 | /* End PBXNativeTarget section */ 114 | 115 | /* Begin PBXProject section */ 116 | E6C82BE51A886B54002D55A2 /* Project object */ = { 117 | isa = PBXProject; 118 | attributes = { 119 | LastSwiftUpdateCheck = 0700; 120 | LastUpgradeCheck = 0910; 121 | ORGANIZATIONNAME = "Majesty Software"; 122 | TargetAttributes = { 123 | E6C82BED1A886B54002D55A2 = { 124 | CreatedOnToolsVersion = 6.1.1; 125 | LastSwiftMigration = 0910; 126 | }; 127 | }; 128 | }; 129 | buildConfigurationList = E6C82BE81A886B54002D55A2 /* Build configuration list for PBXProject "MailScripting" */; 130 | compatibilityVersion = "Xcode 3.2"; 131 | developmentRegion = English; 132 | hasScannedForEncodings = 0; 133 | knownRegions = ( 134 | en, 135 | ); 136 | mainGroup = E6C82BE41A886B54002D55A2; 137 | productRefGroup = E6C82BEF1A886B54002D55A2 /* Products */; 138 | projectDirPath = ""; 139 | projectRoot = ""; 140 | targets = ( 141 | E6C82BED1A886B54002D55A2 /* MailScripting */, 142 | ); 143 | }; 144 | /* End PBXProject section */ 145 | 146 | /* Begin PBXResourcesBuildPhase section */ 147 | E6C82BEC1A886B54002D55A2 /* Resources */ = { 148 | isa = PBXResourcesBuildPhase; 149 | buildActionMask = 2147483647; 150 | files = ( 151 | ); 152 | runOnlyForDeploymentPostprocessing = 0; 153 | }; 154 | /* End PBXResourcesBuildPhase section */ 155 | 156 | /* Begin PBXSourcesBuildPhase section */ 157 | E6C82BE91A886B54002D55A2 /* Sources */ = { 158 | isa = PBXSourcesBuildPhase; 159 | buildActionMask = 2147483647; 160 | files = ( 161 | E6D7AE7D1AABF64500E8E744 /* MailScripting.swift in Sources */, 162 | E6C82C101A886BB9002D55A2 /* Mail.swift in Sources */, 163 | ); 164 | runOnlyForDeploymentPostprocessing = 0; 165 | }; 166 | /* End PBXSourcesBuildPhase section */ 167 | 168 | /* Begin XCBuildConfiguration section */ 169 | E6C82C021A886B54002D55A2 /* Debug */ = { 170 | isa = XCBuildConfiguration; 171 | buildSettings = { 172 | ALWAYS_SEARCH_USER_PATHS = NO; 173 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 174 | CLANG_CXX_LIBRARY = "libc++"; 175 | CLANG_ENABLE_MODULES = YES; 176 | CLANG_ENABLE_OBJC_ARC = YES; 177 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 178 | CLANG_WARN_BOOL_CONVERSION = YES; 179 | CLANG_WARN_COMMA = YES; 180 | CLANG_WARN_CONSTANT_CONVERSION = YES; 181 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 182 | CLANG_WARN_EMPTY_BODY = YES; 183 | CLANG_WARN_ENUM_CONVERSION = YES; 184 | CLANG_WARN_INFINITE_RECURSION = YES; 185 | CLANG_WARN_INT_CONVERSION = YES; 186 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 187 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 188 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 189 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 190 | CLANG_WARN_STRICT_PROTOTYPES = YES; 191 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 192 | CLANG_WARN_UNREACHABLE_CODE = YES; 193 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 194 | COPY_PHASE_STRIP = NO; 195 | CURRENT_PROJECT_VERSION = 1; 196 | ENABLE_STRICT_OBJC_MSGSEND = YES; 197 | ENABLE_TESTABILITY = YES; 198 | GCC_C_LANGUAGE_STANDARD = gnu99; 199 | GCC_DYNAMIC_NO_PIC = NO; 200 | GCC_NO_COMMON_BLOCKS = YES; 201 | GCC_OPTIMIZATION_LEVEL = 0; 202 | GCC_PREPROCESSOR_DEFINITIONS = ( 203 | "DEBUG=1", 204 | "$(inherited)", 205 | ); 206 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 207 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 208 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 209 | GCC_WARN_UNDECLARED_SELECTOR = YES; 210 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 211 | GCC_WARN_UNUSED_FUNCTION = YES; 212 | GCC_WARN_UNUSED_VARIABLE = YES; 213 | MACOSX_DEPLOYMENT_TARGET = 10.9; 214 | MTL_ENABLE_DEBUG_INFO = YES; 215 | ONLY_ACTIVE_ARCH = YES; 216 | SDKROOT = macosx; 217 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 218 | VERSIONING_SYSTEM = "apple-generic"; 219 | VERSION_INFO_PREFIX = ""; 220 | }; 221 | name = Debug; 222 | }; 223 | E6C82C031A886B54002D55A2 /* Release */ = { 224 | isa = XCBuildConfiguration; 225 | buildSettings = { 226 | ALWAYS_SEARCH_USER_PATHS = NO; 227 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 228 | CLANG_CXX_LIBRARY = "libc++"; 229 | CLANG_ENABLE_MODULES = YES; 230 | CLANG_ENABLE_OBJC_ARC = YES; 231 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 232 | CLANG_WARN_BOOL_CONVERSION = YES; 233 | CLANG_WARN_COMMA = YES; 234 | CLANG_WARN_CONSTANT_CONVERSION = YES; 235 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 236 | CLANG_WARN_EMPTY_BODY = YES; 237 | CLANG_WARN_ENUM_CONVERSION = YES; 238 | CLANG_WARN_INFINITE_RECURSION = YES; 239 | CLANG_WARN_INT_CONVERSION = YES; 240 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 241 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 242 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 243 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 244 | CLANG_WARN_STRICT_PROTOTYPES = YES; 245 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 246 | CLANG_WARN_UNREACHABLE_CODE = YES; 247 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 248 | COPY_PHASE_STRIP = YES; 249 | CURRENT_PROJECT_VERSION = 1; 250 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 251 | ENABLE_NS_ASSERTIONS = NO; 252 | ENABLE_STRICT_OBJC_MSGSEND = YES; 253 | GCC_C_LANGUAGE_STANDARD = gnu99; 254 | GCC_NO_COMMON_BLOCKS = YES; 255 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 256 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 257 | GCC_WARN_UNDECLARED_SELECTOR = YES; 258 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 259 | GCC_WARN_UNUSED_FUNCTION = YES; 260 | GCC_WARN_UNUSED_VARIABLE = YES; 261 | MACOSX_DEPLOYMENT_TARGET = 10.9; 262 | MTL_ENABLE_DEBUG_INFO = NO; 263 | SDKROOT = macosx; 264 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 265 | VERSIONING_SYSTEM = "apple-generic"; 266 | VERSION_INFO_PREFIX = ""; 267 | }; 268 | name = Release; 269 | }; 270 | E6C82C051A886B54002D55A2 /* Debug */ = { 271 | isa = XCBuildConfiguration; 272 | buildSettings = { 273 | COMBINE_HIDPI_IMAGES = YES; 274 | DEFINES_MODULE = YES; 275 | DYLIB_COMPATIBILITY_VERSION = 1; 276 | DYLIB_CURRENT_VERSION = 1; 277 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 278 | FRAMEWORK_VERSION = A; 279 | INFOPLIST_FILE = MailScripting/Info.plist; 280 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 281 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 282 | PRODUCT_BUNDLE_IDENTIFIER = "com.majestysoftware.$(PRODUCT_NAME:rfc1034identifier)"; 283 | PRODUCT_NAME = "$(TARGET_NAME)"; 284 | SKIP_INSTALL = YES; 285 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 286 | SWIFT_VERSION = 4.0; 287 | }; 288 | name = Debug; 289 | }; 290 | E6C82C061A886B54002D55A2 /* Release */ = { 291 | isa = XCBuildConfiguration; 292 | buildSettings = { 293 | COMBINE_HIDPI_IMAGES = YES; 294 | DEFINES_MODULE = YES; 295 | DYLIB_COMPATIBILITY_VERSION = 1; 296 | DYLIB_CURRENT_VERSION = 1; 297 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 298 | FRAMEWORK_VERSION = A; 299 | INFOPLIST_FILE = MailScripting/Info.plist; 300 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 301 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 302 | PRODUCT_BUNDLE_IDENTIFIER = "com.majestysoftware.$(PRODUCT_NAME:rfc1034identifier)"; 303 | PRODUCT_NAME = "$(TARGET_NAME)"; 304 | SKIP_INSTALL = YES; 305 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 306 | SWIFT_VERSION = 4.0; 307 | }; 308 | name = Release; 309 | }; 310 | /* End XCBuildConfiguration section */ 311 | 312 | /* Begin XCConfigurationList section */ 313 | E6C82BE81A886B54002D55A2 /* Build configuration list for PBXProject "MailScripting" */ = { 314 | isa = XCConfigurationList; 315 | buildConfigurations = ( 316 | E6C82C021A886B54002D55A2 /* Debug */, 317 | E6C82C031A886B54002D55A2 /* Release */, 318 | ); 319 | defaultConfigurationIsVisible = 0; 320 | defaultConfigurationName = Release; 321 | }; 322 | E6C82C041A886B54002D55A2 /* Build configuration list for PBXNativeTarget "MailScripting" */ = { 323 | isa = XCConfigurationList; 324 | buildConfigurations = ( 325 | E6C82C051A886B54002D55A2 /* Debug */, 326 | E6C82C061A886B54002D55A2 /* Release */, 327 | ); 328 | defaultConfigurationIsVisible = 0; 329 | defaultConfigurationName = Release; 330 | }; 331 | /* End XCConfigurationList section */ 332 | }; 333 | rootObject = E6C82BE51A886B54002D55A2 /* Project object */; 334 | } 335 | -------------------------------------------------------------------------------- /Frameworks/MailScripting/MailScripting.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Frameworks/MailScripting/MailScripting/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2015 Majesty Software. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Frameworks/MailScripting/MailScripting/MailScripting.h: -------------------------------------------------------------------------------- 1 | // 2 | // MailScripting.h 3 | // MailScripting 4 | // 5 | // Copyright (c) 2015 Majesty Software. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | //! Project version number for MailScripting. 29 | FOUNDATION_EXPORT double MailScriptingVersionNumber; 30 | 31 | //! Project version string for MailScripting. 32 | FOUNDATION_EXPORT const unsigned char MailScriptingVersionString[]; 33 | 34 | // In this header, you should import all the public headers of your framework using statements like #import 35 | -------------------------------------------------------------------------------- /Frameworks/MailScripting/MailScripting/MailScripting.swift: -------------------------------------------------------------------------------- 1 | public enum MailScripting: String { 2 | case oldMessageEditor = "OLD message editor" 3 | case account = "account" 4 | case application = "application" 5 | case attachment = "attachment" 6 | case attributeRun = "attribute run" 7 | case bccRecipient = "bcc recipient" 8 | case ccRecipient = "cc recipient" 9 | case character = "character" 10 | case container = "container" 11 | case header = "header" 12 | case icloudAccount = "iCloud account" 13 | case imapAccount = "imap account" 14 | case ldapServer = "ldap server" 15 | case mailAttachment = "mail attachment" 16 | case mailbox = "mailbox" 17 | case messageViewer = "message viewer" 18 | case message = "message" 19 | case outgoingMessage = "outgoing message" 20 | case paragraph = "paragraph" 21 | case popAccount = "pop account" 22 | case recipient = "recipient" 23 | case richText = "rich text" 24 | case ruleCondition = "rule condition" 25 | case rule = "rule" 26 | case signature = "signature" 27 | case smtpServer = "smtp server" 28 | case toRecipient = "to recipient" 29 | case word = "word" 30 | } 31 | -------------------------------------------------------------------------------- /Frameworks/MessagesScripting/MessagesScripting.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Frameworks/MessagesScripting/MessagesScripting/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2015 Majesty Software. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Frameworks/MessagesScripting/MessagesScripting/MessagesScripting.h: -------------------------------------------------------------------------------- 1 | // 2 | // MessagesScripting.h 3 | // MessagesScripting 4 | // 5 | // Copyright (c) 2015 Majesty Software. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | //! Project version number for MessagesScripting. 29 | FOUNDATION_EXPORT double MessagesScriptingVersionNumber; 30 | 31 | //! Project version string for MessagesScripting. 32 | FOUNDATION_EXPORT const unsigned char MessagesScriptingVersionString[]; 33 | 34 | // In this header, you should import all the public headers of your framework using statements like #import 35 | -------------------------------------------------------------------------------- /Frameworks/MessagesScripting/MessagesScripting/MessagesScripting.swift: -------------------------------------------------------------------------------- 1 | public enum MessagesScripting: String { 2 | case application = "application" 3 | case attachment = "attachment" 4 | case attributeRun = "attribute run" 5 | case audioChat = "audio chat" 6 | case authorizationRequest = "authorization request" 7 | case buddy = "buddy" 8 | case character = "character" 9 | case chat = "chat" 10 | case color = "color" 11 | case document = "document" 12 | case fileTransfer = "file transfer" 13 | case item = "item" 14 | case paragraph = "paragraph" 15 | case richText = "rich text" 16 | case service = "service" 17 | case textChat = "text chat" 18 | case videoChat = "video chat" 19 | case window = "window" 20 | case word = "word" 21 | } 22 | -------------------------------------------------------------------------------- /Frameworks/PagesScripting/PagesScripting.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | E62C7A781A55AED00039CF00 /* PagesScripting.h in Headers */ = {isa = PBXBuildFile; fileRef = E62C7A5F1A55AB470039CF00 /* PagesScripting.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | E6C82BC61A884EE4002D55A2 /* Pages.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6C82BC31A884EE4002D55A2 /* Pages.swift */; }; 12 | E6D7AE811AABF67100E8E744 /* PagesScripting.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6D7AE801AABF67100E8E744 /* PagesScripting.swift */; }; 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXFileReference section */ 16 | E62C7A5A1A55AB470039CF00 /* PagesScripting.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PagesScripting.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 17 | E62C7A5E1A55AB470039CF00 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 18 | E62C7A5F1A55AB470039CF00 /* PagesScripting.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PagesScripting.h; sourceTree = ""; }; 19 | E62C7A761A55AB6A0039CF00 /* Pages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pages.h; sourceTree = ""; }; 20 | E6C82BC21A884EE4002D55A2 /* Pages.sdef */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Pages.sdef; sourceTree = ""; }; 21 | E6C82BC31A884EE4002D55A2 /* Pages.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Pages.swift; sourceTree = ""; }; 22 | E6D7AE801AABF67100E8E744 /* PagesScripting.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PagesScripting.swift; sourceTree = ""; }; 23 | /* End PBXFileReference section */ 24 | 25 | /* Begin PBXFrameworksBuildPhase section */ 26 | E62C7A561A55AB470039CF00 /* Frameworks */ = { 27 | isa = PBXFrameworksBuildPhase; 28 | buildActionMask = 2147483647; 29 | files = ( 30 | ); 31 | runOnlyForDeploymentPostprocessing = 0; 32 | }; 33 | /* End PBXFrameworksBuildPhase section */ 34 | 35 | /* Begin PBXGroup section */ 36 | E62C7A501A55AB470039CF00 = { 37 | isa = PBXGroup; 38 | children = ( 39 | E62C7A5C1A55AB470039CF00 /* PagesScripting */, 40 | E62C7A5B1A55AB470039CF00 /* Products */, 41 | ); 42 | sourceTree = ""; 43 | }; 44 | E62C7A5B1A55AB470039CF00 /* Products */ = { 45 | isa = PBXGroup; 46 | children = ( 47 | E62C7A5A1A55AB470039CF00 /* PagesScripting.framework */, 48 | ); 49 | name = Products; 50 | sourceTree = ""; 51 | }; 52 | E62C7A5C1A55AB470039CF00 /* PagesScripting */ = { 53 | isa = PBXGroup; 54 | children = ( 55 | E6C82BC11A884EC4002D55A2 /* ObjC Header */, 56 | E62C7A5F1A55AB470039CF00 /* PagesScripting.h */, 57 | E6C82BC31A884EE4002D55A2 /* Pages.swift */, 58 | E6D7AE801AABF67100E8E744 /* PagesScripting.swift */, 59 | E62C7A5D1A55AB470039CF00 /* Supporting Files */, 60 | ); 61 | path = PagesScripting; 62 | sourceTree = ""; 63 | }; 64 | E62C7A5D1A55AB470039CF00 /* Supporting Files */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | E62C7A5E1A55AB470039CF00 /* Info.plist */, 68 | ); 69 | name = "Supporting Files"; 70 | sourceTree = ""; 71 | }; 72 | E6C82BC11A884EC4002D55A2 /* ObjC Header */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | E62C7A761A55AB6A0039CF00 /* Pages.h */, 76 | E6C82BC21A884EE4002D55A2 /* Pages.sdef */, 77 | ); 78 | name = "ObjC Header"; 79 | sourceTree = ""; 80 | }; 81 | /* End PBXGroup section */ 82 | 83 | /* Begin PBXHeadersBuildPhase section */ 84 | E62C7A571A55AB470039CF00 /* Headers */ = { 85 | isa = PBXHeadersBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | E62C7A781A55AED00039CF00 /* PagesScripting.h in Headers */, 89 | ); 90 | runOnlyForDeploymentPostprocessing = 0; 91 | }; 92 | /* End PBXHeadersBuildPhase section */ 93 | 94 | /* Begin PBXNativeTarget section */ 95 | E62C7A591A55AB470039CF00 /* PagesScripting */ = { 96 | isa = PBXNativeTarget; 97 | buildConfigurationList = E62C7A701A55AB470039CF00 /* Build configuration list for PBXNativeTarget "PagesScripting" */; 98 | buildPhases = ( 99 | E62C7A551A55AB470039CF00 /* Sources */, 100 | E62C7A561A55AB470039CF00 /* Frameworks */, 101 | E62C7A571A55AB470039CF00 /* Headers */, 102 | E62C7A581A55AB470039CF00 /* Resources */, 103 | ); 104 | buildRules = ( 105 | ); 106 | dependencies = ( 107 | ); 108 | name = PagesScripting; 109 | productName = PagesScripting; 110 | productReference = E62C7A5A1A55AB470039CF00 /* PagesScripting.framework */; 111 | productType = "com.apple.product-type.framework"; 112 | }; 113 | /* End PBXNativeTarget section */ 114 | 115 | /* Begin PBXProject section */ 116 | E62C7A511A55AB470039CF00 /* Project object */ = { 117 | isa = PBXProject; 118 | attributes = { 119 | LastSwiftUpdateCheck = 0700; 120 | LastUpgradeCheck = 0910; 121 | ORGANIZATIONNAME = "Majesty Software"; 122 | TargetAttributes = { 123 | E62C7A591A55AB470039CF00 = { 124 | CreatedOnToolsVersion = 6.1.1; 125 | LastSwiftMigration = 0910; 126 | }; 127 | }; 128 | }; 129 | buildConfigurationList = E62C7A541A55AB470039CF00 /* Build configuration list for PBXProject "PagesScripting" */; 130 | compatibilityVersion = "Xcode 3.2"; 131 | developmentRegion = English; 132 | hasScannedForEncodings = 0; 133 | knownRegions = ( 134 | en, 135 | ); 136 | mainGroup = E62C7A501A55AB470039CF00; 137 | productRefGroup = E62C7A5B1A55AB470039CF00 /* Products */; 138 | projectDirPath = ""; 139 | projectRoot = ""; 140 | targets = ( 141 | E62C7A591A55AB470039CF00 /* PagesScripting */, 142 | ); 143 | }; 144 | /* End PBXProject section */ 145 | 146 | /* Begin PBXResourcesBuildPhase section */ 147 | E62C7A581A55AB470039CF00 /* Resources */ = { 148 | isa = PBXResourcesBuildPhase; 149 | buildActionMask = 2147483647; 150 | files = ( 151 | ); 152 | runOnlyForDeploymentPostprocessing = 0; 153 | }; 154 | /* End PBXResourcesBuildPhase section */ 155 | 156 | /* Begin PBXSourcesBuildPhase section */ 157 | E62C7A551A55AB470039CF00 /* Sources */ = { 158 | isa = PBXSourcesBuildPhase; 159 | buildActionMask = 2147483647; 160 | files = ( 161 | E6D7AE811AABF67100E8E744 /* PagesScripting.swift in Sources */, 162 | E6C82BC61A884EE4002D55A2 /* Pages.swift in Sources */, 163 | ); 164 | runOnlyForDeploymentPostprocessing = 0; 165 | }; 166 | /* End PBXSourcesBuildPhase section */ 167 | 168 | /* Begin XCBuildConfiguration section */ 169 | E62C7A6E1A55AB470039CF00 /* Debug */ = { 170 | isa = XCBuildConfiguration; 171 | buildSettings = { 172 | ALWAYS_SEARCH_USER_PATHS = NO; 173 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 174 | CLANG_CXX_LIBRARY = "libc++"; 175 | CLANG_ENABLE_MODULES = YES; 176 | CLANG_ENABLE_OBJC_ARC = YES; 177 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 178 | CLANG_WARN_BOOL_CONVERSION = YES; 179 | CLANG_WARN_COMMA = YES; 180 | CLANG_WARN_CONSTANT_CONVERSION = YES; 181 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 182 | CLANG_WARN_EMPTY_BODY = YES; 183 | CLANG_WARN_ENUM_CONVERSION = YES; 184 | CLANG_WARN_INFINITE_RECURSION = YES; 185 | CLANG_WARN_INT_CONVERSION = YES; 186 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 187 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 188 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 189 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 190 | CLANG_WARN_STRICT_PROTOTYPES = YES; 191 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 192 | CLANG_WARN_UNREACHABLE_CODE = YES; 193 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 194 | COPY_PHASE_STRIP = NO; 195 | CURRENT_PROJECT_VERSION = 1; 196 | ENABLE_STRICT_OBJC_MSGSEND = YES; 197 | ENABLE_TESTABILITY = YES; 198 | GCC_C_LANGUAGE_STANDARD = gnu99; 199 | GCC_DYNAMIC_NO_PIC = NO; 200 | GCC_NO_COMMON_BLOCKS = YES; 201 | GCC_OPTIMIZATION_LEVEL = 0; 202 | GCC_PREPROCESSOR_DEFINITIONS = ( 203 | "DEBUG=1", 204 | "$(inherited)", 205 | ); 206 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 207 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 208 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 209 | GCC_WARN_UNDECLARED_SELECTOR = YES; 210 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 211 | GCC_WARN_UNUSED_FUNCTION = YES; 212 | GCC_WARN_UNUSED_VARIABLE = YES; 213 | MACOSX_DEPLOYMENT_TARGET = 10.9; 214 | MTL_ENABLE_DEBUG_INFO = YES; 215 | ONLY_ACTIVE_ARCH = YES; 216 | SDKROOT = macosx; 217 | VERSIONING_SYSTEM = "apple-generic"; 218 | VERSION_INFO_PREFIX = ""; 219 | }; 220 | name = Debug; 221 | }; 222 | E62C7A6F1A55AB470039CF00 /* Release */ = { 223 | isa = XCBuildConfiguration; 224 | buildSettings = { 225 | ALWAYS_SEARCH_USER_PATHS = NO; 226 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 227 | CLANG_CXX_LIBRARY = "libc++"; 228 | CLANG_ENABLE_MODULES = YES; 229 | CLANG_ENABLE_OBJC_ARC = YES; 230 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 231 | CLANG_WARN_BOOL_CONVERSION = YES; 232 | CLANG_WARN_COMMA = YES; 233 | CLANG_WARN_CONSTANT_CONVERSION = YES; 234 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 235 | CLANG_WARN_EMPTY_BODY = YES; 236 | CLANG_WARN_ENUM_CONVERSION = YES; 237 | CLANG_WARN_INFINITE_RECURSION = YES; 238 | CLANG_WARN_INT_CONVERSION = YES; 239 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 240 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 241 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 242 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 243 | CLANG_WARN_STRICT_PROTOTYPES = YES; 244 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 245 | CLANG_WARN_UNREACHABLE_CODE = YES; 246 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 247 | COPY_PHASE_STRIP = YES; 248 | CURRENT_PROJECT_VERSION = 1; 249 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 250 | ENABLE_NS_ASSERTIONS = NO; 251 | ENABLE_STRICT_OBJC_MSGSEND = YES; 252 | GCC_C_LANGUAGE_STANDARD = gnu99; 253 | GCC_NO_COMMON_BLOCKS = YES; 254 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 255 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 256 | GCC_WARN_UNDECLARED_SELECTOR = YES; 257 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 258 | GCC_WARN_UNUSED_FUNCTION = YES; 259 | GCC_WARN_UNUSED_VARIABLE = YES; 260 | MACOSX_DEPLOYMENT_TARGET = 10.9; 261 | MTL_ENABLE_DEBUG_INFO = NO; 262 | SDKROOT = macosx; 263 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 264 | VERSIONING_SYSTEM = "apple-generic"; 265 | VERSION_INFO_PREFIX = ""; 266 | }; 267 | name = Release; 268 | }; 269 | E62C7A711A55AB470039CF00 /* Debug */ = { 270 | isa = XCBuildConfiguration; 271 | buildSettings = { 272 | COMBINE_HIDPI_IMAGES = YES; 273 | DEFINES_MODULE = YES; 274 | DYLIB_COMPATIBILITY_VERSION = 1; 275 | DYLIB_CURRENT_VERSION = 1; 276 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 277 | FRAMEWORK_VERSION = A; 278 | INFOPLIST_FILE = PagesScripting/Info.plist; 279 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 280 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 281 | PRODUCT_BUNDLE_IDENTIFIER = "com.majestysoftware.$(PRODUCT_NAME:rfc1034identifier)"; 282 | PRODUCT_NAME = "$(TARGET_NAME)"; 283 | SKIP_INSTALL = YES; 284 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 285 | SWIFT_VERSION = 4.0; 286 | }; 287 | name = Debug; 288 | }; 289 | E62C7A721A55AB470039CF00 /* Release */ = { 290 | isa = XCBuildConfiguration; 291 | buildSettings = { 292 | COMBINE_HIDPI_IMAGES = YES; 293 | DEFINES_MODULE = YES; 294 | DYLIB_COMPATIBILITY_VERSION = 1; 295 | DYLIB_CURRENT_VERSION = 1; 296 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 297 | FRAMEWORK_VERSION = A; 298 | INFOPLIST_FILE = PagesScripting/Info.plist; 299 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 300 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 301 | PRODUCT_BUNDLE_IDENTIFIER = "com.majestysoftware.$(PRODUCT_NAME:rfc1034identifier)"; 302 | PRODUCT_NAME = "$(TARGET_NAME)"; 303 | SKIP_INSTALL = YES; 304 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 305 | SWIFT_VERSION = 4.0; 306 | }; 307 | name = Release; 308 | }; 309 | /* End XCBuildConfiguration section */ 310 | 311 | /* Begin XCConfigurationList section */ 312 | E62C7A541A55AB470039CF00 /* Build configuration list for PBXProject "PagesScripting" */ = { 313 | isa = XCConfigurationList; 314 | buildConfigurations = ( 315 | E62C7A6E1A55AB470039CF00 /* Debug */, 316 | E62C7A6F1A55AB470039CF00 /* Release */, 317 | ); 318 | defaultConfigurationIsVisible = 0; 319 | defaultConfigurationName = Release; 320 | }; 321 | E62C7A701A55AB470039CF00 /* Build configuration list for PBXNativeTarget "PagesScripting" */ = { 322 | isa = XCConfigurationList; 323 | buildConfigurations = ( 324 | E62C7A711A55AB470039CF00 /* Debug */, 325 | E62C7A721A55AB470039CF00 /* Release */, 326 | ); 327 | defaultConfigurationIsVisible = 0; 328 | defaultConfigurationName = Release; 329 | }; 330 | /* End XCConfigurationList section */ 331 | }; 332 | rootObject = E62C7A511A55AB470039CF00 /* Project object */; 333 | } 334 | -------------------------------------------------------------------------------- /Frameworks/PagesScripting/PagesScripting.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Frameworks/PagesScripting/PagesScripting/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2015 Majesty Software. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Frameworks/PagesScripting/PagesScripting/PagesScripting.h: -------------------------------------------------------------------------------- 1 | // 2 | // PagesScripting.h 3 | // PagesScripting 4 | // 5 | // Copyright (c) 2015 Majesty Software. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | //! Project version number for PagesScripting. 29 | FOUNDATION_EXPORT double PagesScriptingVersionNumber; 30 | 31 | //! Project version string for PagesScripting. 32 | FOUNDATION_EXPORT const unsigned char PagesScriptingVersionString[]; 33 | 34 | // In this header, you should import all the public headers of your framework using statements like #import 35 | -------------------------------------------------------------------------------- /Frameworks/PagesScripting/PagesScripting/PagesScripting.swift: -------------------------------------------------------------------------------- 1 | public enum PagesScripting: String { 2 | case application = "application" 3 | case audioClip = "audio clip" 4 | case cell = "cell" 5 | case character = "character" 6 | case chart = "chart" 7 | case column = "column" 8 | case document = "document" 9 | case group = "group" 10 | case iworkContainer = "iWork container" 11 | case iworkItem = "iWork item" 12 | case image = "image" 13 | case line = "line" 14 | case movie = "movie" 15 | case page = "page" 16 | case paragraph = "paragraph" 17 | case placeholderText = "placeholder text" 18 | case range = "range" 19 | case richText = "rich text" 20 | case row = "row" 21 | case section = "section" 22 | case shape = "shape" 23 | case table = "table" 24 | case template = "template" 25 | case textItem = "text item" 26 | case word = "word" 27 | } 28 | -------------------------------------------------------------------------------- /Frameworks/SafariScripting/SafariScripting.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Frameworks/SafariScripting/SafariScripting/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSHumanReadableCopyright 22 | Copyright © 2017 Majesty Software. All rights reserved. 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Frameworks/SafariScripting/SafariScripting/Safari.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Safari.h 3 | */ 4 | 5 | #import 6 | #import 7 | 8 | 9 | @class SafariApplication, SafariDocument, SafariWindow, SafariTab, SafariSourceProvider, SafariContentsProvider; 10 | 11 | enum SafariSaveOptions { 12 | SafariSaveOptionsYes = 'yes ' /* Save the file. */, 13 | SafariSaveOptionsNo = 'no ' /* Do not save the file. */, 14 | SafariSaveOptionsAsk = 'ask ' /* Ask the user whether or not to save the file. */ 15 | }; 16 | typedef enum SafariSaveOptions SafariSaveOptions; 17 | 18 | enum SafariPrintingErrorHandling { 19 | SafariPrintingErrorHandlingStandard = 'lwst' /* Standard PostScript error handling */, 20 | SafariPrintingErrorHandlingDetailed = 'lwdt' /* print a detailed report of PostScript errors */ 21 | }; 22 | typedef enum SafariPrintingErrorHandling SafariPrintingErrorHandling; 23 | 24 | @protocol SafariGenericMethods 25 | 26 | - (void) closeSaving:(SafariSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document. 27 | - (void) saveIn:(NSURL *)in_ as:(id)as; // Save a document. 28 | - (void) printWithProperties:(NSDictionary *)withProperties printDialog:(BOOL)printDialog; // Print a document. 29 | - (void) delete; // Delete an object. 30 | - (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy an object. 31 | - (void) moveTo:(SBObject *)to; // Move an object to a new location. 32 | 33 | @end 34 | 35 | 36 | 37 | /* 38 | * Standard Suite 39 | */ 40 | 41 | // The application's top-level scripting object. 42 | @interface SafariApplication : SBApplication 43 | 44 | - (SBElementArray *) documents; 45 | - (SBElementArray *) windows; 46 | 47 | @property (copy, readonly) NSString *name; // The name of the application. 48 | @property (readonly) BOOL frontmost; // Is this the active application? 49 | @property (copy, readonly) NSString *version; // The version number of the application. 50 | 51 | - (id) open:(id)x; // Open a document. 52 | - (void) print:(id)x withProperties:(NSDictionary *)withProperties printDialog:(BOOL)printDialog; // Print a document. 53 | - (void) quitSaving:(SafariSaveOptions)saving; // Quit the application. 54 | - (BOOL) exists:(id)x; // Verify that an object exists. 55 | - (void) addReadingListItem:(NSString *)x andPreviewText:(NSString *)andPreviewText withTitle:(NSString *)withTitle; // Add a new Reading List item with the given URL. Allows a custom title and preview text to be specified. 56 | - (id) doJavaScript:(NSString *)x in:(id)in_; // Applies a string of JavaScript code to a document. 57 | - (void) emailContentsOf:(id)of; // Emails the contents of a tab. 58 | - (void) searchTheWebIn:(id)in_ for:(NSString *)for_; // Searches the web using Safari's current search provider. 59 | - (void) showBookmarks; // Shows Safari's bookmarks. 60 | 61 | @end 62 | 63 | // A document. 64 | @interface SafariDocument : SBObject 65 | 66 | @property (copy, readonly) NSString *name; // Its name. 67 | @property (readonly) BOOL modified; // Has it been modified since the last save? 68 | @property (copy, readonly) NSURL *file; // Its location on disk, if it has one. 69 | 70 | 71 | @end 72 | 73 | // A window. 74 | @interface SafariWindow : SBObject 75 | 76 | @property (copy, readonly) NSString *name; // The title of the window. 77 | - (NSInteger) id; // The unique identifier of the window. 78 | @property NSInteger index; // The index of the window, ordered front to back. 79 | @property NSRect bounds; // The bounding rectangle of the window. 80 | @property (readonly) BOOL closeable; // Does the window have a close button? 81 | @property (readonly) BOOL miniaturizable; // Does the window have a minimize button? 82 | @property BOOL miniaturized; // Is the window minimized right now? 83 | @property (readonly) BOOL resizable; // Can the window be resized? 84 | @property BOOL visible; // Is the window visible right now? 85 | @property (readonly) BOOL zoomable; // Does the window have a zoom button? 86 | @property BOOL zoomed; // Is the window zoomed right now? 87 | @property (copy, readonly) SafariDocument *document; // The document whose contents are displayed in the window. 88 | 89 | 90 | @end 91 | 92 | 93 | 94 | /* 95 | * Safari suite 96 | */ 97 | 98 | // A Safari window. 99 | @interface SafariWindow (SafariSuite) 100 | 101 | - (SBElementArray *) tabs; 102 | 103 | @property (copy) SafariTab *currentTab; // The current tab. 104 | 105 | @end 106 | 107 | // A Safari document representing the active tab in a window. 108 | @interface SafariDocument (SafariSuite) 109 | 110 | @property (copy, readonly) NSString *source; // The HTML source of the web page currently loaded in the document. 111 | @property (copy) NSString *URL; // The current URL of the document. 112 | @property (copy, readonly) NSString *text; // The text of the web page currently loaded in the document. Modifications to text aren't reflected on the web page. 113 | 114 | @end 115 | 116 | // A Safari window tab. 117 | @interface SafariTab : SBObject 118 | 119 | @property (copy, readonly) NSString *source; // The HTML source of the web page currently loaded in the tab. 120 | @property (copy) NSString *URL; // The current URL of the tab. 121 | @property (copy, readonly) NSNumber *index; // The index of the tab, ordered left to right. 122 | @property (copy, readonly) NSString *text; // The text of the web page currently loaded in the tab. Modifications to text aren't reflected on the web page. 123 | @property (readonly) BOOL visible; // Whether the tab is currently visible. 124 | @property (copy, readonly) NSString *name; // The name of the tab. 125 | 126 | 127 | @end 128 | 129 | -------------------------------------------------------------------------------- /Frameworks/SafariScripting/SafariScripting/Safari.sdef: -------------------------------------------------------------------------------- 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 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 81 | 82 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 141 | 142 | 147 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /Frameworks/SafariScripting/SafariScripting/Safari.swift: -------------------------------------------------------------------------------- 1 | import AppKit 2 | import ScriptingBridge 3 | 4 | @objc public protocol SBObjectProtocol: NSObjectProtocol { 5 | func get() -> Any! 6 | } 7 | 8 | @objc public protocol SBApplicationProtocol: SBObjectProtocol { 9 | func activate() 10 | var delegate: SBApplicationDelegate! { get set } 11 | var isRunning: Bool { get } 12 | } 13 | 14 | // MARK: SafariSaveOptions 15 | @objc public enum SafariSaveOptions : AEKeyword { 16 | case yes = 0x79657320 /* 'yes ' */ 17 | case no = 0x6e6f2020 /* 'no ' */ 18 | case ask = 0x61736b20 /* 'ask ' */ 19 | } 20 | 21 | // MARK: SafariPrintingErrorHandling 22 | @objc public enum SafariPrintingErrorHandling : AEKeyword { 23 | case standard = 0x6c777374 /* 'lwst' */ 24 | case detailed = 0x6c776474 /* 'lwdt' */ 25 | } 26 | 27 | // MARK: SafariGenericMethods 28 | @objc public protocol SafariGenericMethods { 29 | @objc optional func closeSaving(_ saving: SafariSaveOptions, savingIn: URL!) // Close a document. 30 | @objc optional func saveIn(_ in_: URL!, as: Any!) // Save a document. 31 | @objc optional func printWithProperties(_ withProperties: [AnyHashable : Any]!, printDialog: Bool) // Print a document. 32 | @objc optional func delete() // Delete an object. 33 | @objc optional func duplicateTo(_ to: SBObject!, withProperties: [AnyHashable : Any]!) // Copy an object. 34 | @objc optional func moveTo(_ to: SBObject!) // Move an object to a new location. 35 | } 36 | 37 | // MARK: SafariApplication 38 | @objc public protocol SafariApplication: SBApplicationProtocol { 39 | @objc optional func documents() -> SBElementArray 40 | @objc optional func windows() -> SBElementArray 41 | @objc optional var name: String { get } // The name of the application. 42 | @objc optional var frontmost: Bool { get } // Is this the active application? 43 | @objc optional var version: String { get } // The version number of the application. 44 | @objc optional func `open`(_ x: Any!) -> Any // Open a document. 45 | @objc optional func print(_ x: Any!, withProperties: [AnyHashable : Any]!, printDialog: Bool) // Print a document. 46 | @objc optional func quitSaving(_ saving: SafariSaveOptions) // Quit the application. 47 | @objc optional func exists(_ x: Any!) -> Bool // Verify that an object exists. 48 | @objc optional func addReadingListItem(_ x: String!, andPreviewText: String!, withTitle: String!) // Add a new Reading List item with the given URL. Allows a custom title and preview text to be specified. 49 | @objc optional func doJavaScript(_ x: String!, in in_: Any!) -> Any // Applies a string of JavaScript code to a document. 50 | @objc optional func emailContentsOf(_ of: Any!) // Emails the contents of a tab. 51 | @objc optional func searchTheWebIn(_ in_: Any!, for for_: String!) // Searches the web using Safari's current search provider. 52 | @objc optional func showBookmarks() // Shows Safari's bookmarks. 53 | } 54 | extension SBApplication: SafariApplication {} 55 | 56 | // MARK: SafariDocument 57 | @objc public protocol SafariDocument: SBObjectProtocol, SafariGenericMethods { 58 | @objc optional var name: String { get } // Its name. 59 | @objc optional var modified: Bool { get } // Has it been modified since the last save? 60 | @objc optional var file: URL { get } // Its location on disk, if it has one. 61 | @objc optional var source: String { get } // The HTML source of the web page currently loaded in the document. 62 | @objc optional var URL: String { get } // The current URL of the document. 63 | @objc optional var text: String { get } // The text of the web page currently loaded in the document. Modifications to text aren't reflected on the web page. 64 | @objc optional func setURL(_ URL: String!) // The current URL of the document. 65 | } 66 | extension SBObject: SafariDocument {} 67 | 68 | // MARK: SafariWindow 69 | @objc public protocol SafariWindow: SBObjectProtocol, SafariGenericMethods { 70 | @objc optional var name: String { get } // The title of the window. 71 | @objc optional func id() -> Int // The unique identifier of the window. 72 | @objc optional var index: Int { get } // The index of the window, ordered front to back. 73 | @objc optional var bounds: NSRect { get } // The bounding rectangle of the window. 74 | @objc optional var closeable: Bool { get } // Does the window have a close button? 75 | @objc optional var miniaturizable: Bool { get } // Does the window have a minimize button? 76 | @objc optional var miniaturized: Bool { get } // Is the window minimized right now? 77 | @objc optional var resizable: Bool { get } // Can the window be resized? 78 | @objc optional var visible: Bool { get } // Is the window visible right now? 79 | @objc optional var zoomable: Bool { get } // Does the window have a zoom button? 80 | @objc optional var zoomed: Bool { get } // Is the window zoomed right now? 81 | @objc optional var document: SafariDocument { get } // The document whose contents are displayed in the window. 82 | @objc optional func setIndex(_ index: Int) // The index of the window, ordered front to back. 83 | @objc optional func setBounds(_ bounds: NSRect) // The bounding rectangle of the window. 84 | @objc optional func setMiniaturized(_ miniaturized: Bool) // Is the window minimized right now? 85 | @objc optional func setVisible(_ visible: Bool) // Is the window visible right now? 86 | @objc optional func setZoomed(_ zoomed: Bool) // Is the window zoomed right now? 87 | @objc optional func tabs() -> SBElementArray 88 | @objc optional var currentTab: SafariTab { get } // The current tab. 89 | @objc optional func setCurrentTab(_ currentTab: SafariTab!) // The current tab. 90 | } 91 | extension SBObject: SafariWindow {} 92 | 93 | // MARK: SafariTab 94 | @objc public protocol SafariTab: SBObjectProtocol, SafariGenericMethods { 95 | @objc optional var source: String { get } // The HTML source of the web page currently loaded in the tab. 96 | @objc optional var URL: String { get } // The current URL of the tab. 97 | @objc optional var index: NSNumber { get } // The index of the tab, ordered left to right. 98 | @objc optional var text: String { get } // The text of the web page currently loaded in the tab. Modifications to text aren't reflected on the web page. 99 | @objc optional var visible: Bool { get } // Whether the tab is currently visible. 100 | @objc optional var name: String { get } // The name of the tab. 101 | @objc optional func setURL(_ URL: String!) // The current URL of the tab. 102 | } 103 | extension SBObject: SafariTab {} 104 | 105 | -------------------------------------------------------------------------------- /Frameworks/SafariScripting/SafariScripting/SafariScripting.h: -------------------------------------------------------------------------------- 1 | // 2 | // SafariScripting.h 3 | // SafariScripting 4 | // 5 | // Created by Tony Ingraldi on 11/2/17. 6 | // Copyright © 2017 Majesty Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for SafariScripting. 12 | FOUNDATION_EXPORT double SafariScriptingVersionNumber; 13 | 14 | //! Project version string for SafariScripting. 15 | FOUNDATION_EXPORT const unsigned char SafariScriptingVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Frameworks/SafariScripting/SafariScripting/SafariScripting.swift: -------------------------------------------------------------------------------- 1 | public enum SafariScripting: String { 2 | case contentsprovider = "contentsProvider" 3 | case document = "document" 4 | case sourceprovider = "sourceProvider" 5 | case tab = "tab" 6 | case window = "window" 7 | } 8 | -------------------------------------------------------------------------------- /Frameworks/ScriptingUtilities/ScriptingUtilities.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | E6981C691A86F52B0097ED59 /* ScriptingUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = E6981C681A86F52B0097ED59 /* ScriptingUtilities.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | E6981C801A86F5490097ED59 /* AppUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6981C7F1A86F5490097ED59 /* AppUtilities.swift */; }; 12 | E6981C821A86F5970097ED59 /* SundryUtilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6981C811A86F5970097ED59 /* SundryUtilities.swift */; }; 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXFileReference section */ 16 | E6981C631A86F52B0097ED59 /* ScriptingUtilities.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ScriptingUtilities.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 17 | E6981C671A86F52B0097ED59 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 18 | E6981C681A86F52B0097ED59 /* ScriptingUtilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScriptingUtilities.h; sourceTree = ""; }; 19 | E6981C7F1A86F5490097ED59 /* AppUtilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppUtilities.swift; sourceTree = ""; }; 20 | E6981C811A86F5970097ED59 /* SundryUtilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SundryUtilities.swift; sourceTree = ""; }; 21 | /* End PBXFileReference section */ 22 | 23 | /* Begin PBXFrameworksBuildPhase section */ 24 | E6981C5F1A86F52B0097ED59 /* Frameworks */ = { 25 | isa = PBXFrameworksBuildPhase; 26 | buildActionMask = 2147483647; 27 | files = ( 28 | ); 29 | runOnlyForDeploymentPostprocessing = 0; 30 | }; 31 | /* End PBXFrameworksBuildPhase section */ 32 | 33 | /* Begin PBXGroup section */ 34 | E6981C591A86F52B0097ED59 = { 35 | isa = PBXGroup; 36 | children = ( 37 | E6981C651A86F52B0097ED59 /* ScriptingUtilities */, 38 | E6981C641A86F52B0097ED59 /* Products */, 39 | ); 40 | sourceTree = ""; 41 | }; 42 | E6981C641A86F52B0097ED59 /* Products */ = { 43 | isa = PBXGroup; 44 | children = ( 45 | E6981C631A86F52B0097ED59 /* ScriptingUtilities.framework */, 46 | ); 47 | name = Products; 48 | sourceTree = ""; 49 | }; 50 | E6981C651A86F52B0097ED59 /* ScriptingUtilities */ = { 51 | isa = PBXGroup; 52 | children = ( 53 | E6981C681A86F52B0097ED59 /* ScriptingUtilities.h */, 54 | E6981C7F1A86F5490097ED59 /* AppUtilities.swift */, 55 | E6981C811A86F5970097ED59 /* SundryUtilities.swift */, 56 | E6981C661A86F52B0097ED59 /* Supporting Files */, 57 | ); 58 | path = ScriptingUtilities; 59 | sourceTree = ""; 60 | }; 61 | E6981C661A86F52B0097ED59 /* Supporting Files */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | E6981C671A86F52B0097ED59 /* Info.plist */, 65 | ); 66 | name = "Supporting Files"; 67 | sourceTree = ""; 68 | }; 69 | /* End PBXGroup section */ 70 | 71 | /* Begin PBXHeadersBuildPhase section */ 72 | E6981C601A86F52B0097ED59 /* Headers */ = { 73 | isa = PBXHeadersBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | E6981C691A86F52B0097ED59 /* ScriptingUtilities.h in Headers */, 77 | ); 78 | runOnlyForDeploymentPostprocessing = 0; 79 | }; 80 | /* End PBXHeadersBuildPhase section */ 81 | 82 | /* Begin PBXNativeTarget section */ 83 | E6981C621A86F52B0097ED59 /* ScriptingUtilities */ = { 84 | isa = PBXNativeTarget; 85 | buildConfigurationList = E6981C791A86F52B0097ED59 /* Build configuration list for PBXNativeTarget "ScriptingUtilities" */; 86 | buildPhases = ( 87 | E6981C5E1A86F52B0097ED59 /* Sources */, 88 | E6981C5F1A86F52B0097ED59 /* Frameworks */, 89 | E6981C601A86F52B0097ED59 /* Headers */, 90 | E6981C611A86F52B0097ED59 /* Resources */, 91 | ); 92 | buildRules = ( 93 | ); 94 | dependencies = ( 95 | ); 96 | name = ScriptingUtilities; 97 | productName = ScriptingUtilities; 98 | productReference = E6981C631A86F52B0097ED59 /* ScriptingUtilities.framework */; 99 | productType = "com.apple.product-type.framework"; 100 | }; 101 | /* End PBXNativeTarget section */ 102 | 103 | /* Begin PBXProject section */ 104 | E6981C5A1A86F52B0097ED59 /* Project object */ = { 105 | isa = PBXProject; 106 | attributes = { 107 | LastSwiftMigration = 0700; 108 | LastSwiftUpdateCheck = 0700; 109 | LastUpgradeCheck = 0910; 110 | ORGANIZATIONNAME = "Majesty Software"; 111 | TargetAttributes = { 112 | E6981C621A86F52B0097ED59 = { 113 | CreatedOnToolsVersion = 6.1.1; 114 | LastSwiftMigration = 0910; 115 | }; 116 | }; 117 | }; 118 | buildConfigurationList = E6981C5D1A86F52B0097ED59 /* Build configuration list for PBXProject "ScriptingUtilities" */; 119 | compatibilityVersion = "Xcode 3.2"; 120 | developmentRegion = English; 121 | hasScannedForEncodings = 0; 122 | knownRegions = ( 123 | en, 124 | ); 125 | mainGroup = E6981C591A86F52B0097ED59; 126 | productRefGroup = E6981C641A86F52B0097ED59 /* Products */; 127 | projectDirPath = ""; 128 | projectRoot = ""; 129 | targets = ( 130 | E6981C621A86F52B0097ED59 /* ScriptingUtilities */, 131 | ); 132 | }; 133 | /* End PBXProject section */ 134 | 135 | /* Begin PBXResourcesBuildPhase section */ 136 | E6981C611A86F52B0097ED59 /* Resources */ = { 137 | isa = PBXResourcesBuildPhase; 138 | buildActionMask = 2147483647; 139 | files = ( 140 | ); 141 | runOnlyForDeploymentPostprocessing = 0; 142 | }; 143 | /* End PBXResourcesBuildPhase section */ 144 | 145 | /* Begin PBXSourcesBuildPhase section */ 146 | E6981C5E1A86F52B0097ED59 /* Sources */ = { 147 | isa = PBXSourcesBuildPhase; 148 | buildActionMask = 2147483647; 149 | files = ( 150 | E6981C801A86F5490097ED59 /* AppUtilities.swift in Sources */, 151 | E6981C821A86F5970097ED59 /* SundryUtilities.swift in Sources */, 152 | ); 153 | runOnlyForDeploymentPostprocessing = 0; 154 | }; 155 | /* End PBXSourcesBuildPhase section */ 156 | 157 | /* Begin XCBuildConfiguration section */ 158 | E6981C771A86F52B0097ED59 /* Debug */ = { 159 | isa = XCBuildConfiguration; 160 | buildSettings = { 161 | ALWAYS_SEARCH_USER_PATHS = NO; 162 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 163 | CLANG_CXX_LIBRARY = "libc++"; 164 | CLANG_ENABLE_MODULES = YES; 165 | CLANG_ENABLE_OBJC_ARC = YES; 166 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 167 | CLANG_WARN_BOOL_CONVERSION = YES; 168 | CLANG_WARN_COMMA = YES; 169 | CLANG_WARN_CONSTANT_CONVERSION = YES; 170 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 171 | CLANG_WARN_EMPTY_BODY = YES; 172 | CLANG_WARN_ENUM_CONVERSION = YES; 173 | CLANG_WARN_INFINITE_RECURSION = YES; 174 | CLANG_WARN_INT_CONVERSION = YES; 175 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 176 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 177 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 178 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 179 | CLANG_WARN_STRICT_PROTOTYPES = YES; 180 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 181 | CLANG_WARN_UNREACHABLE_CODE = YES; 182 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 183 | COPY_PHASE_STRIP = NO; 184 | CURRENT_PROJECT_VERSION = 1; 185 | ENABLE_STRICT_OBJC_MSGSEND = YES; 186 | ENABLE_TESTABILITY = YES; 187 | GCC_C_LANGUAGE_STANDARD = gnu99; 188 | GCC_DYNAMIC_NO_PIC = NO; 189 | GCC_NO_COMMON_BLOCKS = YES; 190 | GCC_OPTIMIZATION_LEVEL = 0; 191 | GCC_PREPROCESSOR_DEFINITIONS = ( 192 | "DEBUG=1", 193 | "$(inherited)", 194 | ); 195 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 196 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 197 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 198 | GCC_WARN_UNDECLARED_SELECTOR = YES; 199 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 200 | GCC_WARN_UNUSED_FUNCTION = YES; 201 | GCC_WARN_UNUSED_VARIABLE = YES; 202 | MACOSX_DEPLOYMENT_TARGET = 10.9; 203 | MTL_ENABLE_DEBUG_INFO = YES; 204 | ONLY_ACTIVE_ARCH = YES; 205 | SDKROOT = macosx; 206 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 207 | VERSIONING_SYSTEM = "apple-generic"; 208 | VERSION_INFO_PREFIX = ""; 209 | }; 210 | name = Debug; 211 | }; 212 | E6981C781A86F52B0097ED59 /* Release */ = { 213 | isa = XCBuildConfiguration; 214 | buildSettings = { 215 | ALWAYS_SEARCH_USER_PATHS = NO; 216 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 217 | CLANG_CXX_LIBRARY = "libc++"; 218 | CLANG_ENABLE_MODULES = YES; 219 | CLANG_ENABLE_OBJC_ARC = YES; 220 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 221 | CLANG_WARN_BOOL_CONVERSION = YES; 222 | CLANG_WARN_COMMA = YES; 223 | CLANG_WARN_CONSTANT_CONVERSION = YES; 224 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 225 | CLANG_WARN_EMPTY_BODY = YES; 226 | CLANG_WARN_ENUM_CONVERSION = YES; 227 | CLANG_WARN_INFINITE_RECURSION = YES; 228 | CLANG_WARN_INT_CONVERSION = YES; 229 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 230 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 231 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 232 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 233 | CLANG_WARN_STRICT_PROTOTYPES = YES; 234 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 235 | CLANG_WARN_UNREACHABLE_CODE = YES; 236 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 237 | COPY_PHASE_STRIP = YES; 238 | CURRENT_PROJECT_VERSION = 1; 239 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 240 | ENABLE_NS_ASSERTIONS = NO; 241 | ENABLE_STRICT_OBJC_MSGSEND = YES; 242 | GCC_C_LANGUAGE_STANDARD = gnu99; 243 | GCC_NO_COMMON_BLOCKS = YES; 244 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 245 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 246 | GCC_WARN_UNDECLARED_SELECTOR = YES; 247 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 248 | GCC_WARN_UNUSED_FUNCTION = YES; 249 | GCC_WARN_UNUSED_VARIABLE = YES; 250 | MACOSX_DEPLOYMENT_TARGET = 10.9; 251 | MTL_ENABLE_DEBUG_INFO = NO; 252 | SDKROOT = macosx; 253 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 254 | VERSIONING_SYSTEM = "apple-generic"; 255 | VERSION_INFO_PREFIX = ""; 256 | }; 257 | name = Release; 258 | }; 259 | E6981C7A1A86F52B0097ED59 /* Debug */ = { 260 | isa = XCBuildConfiguration; 261 | buildSettings = { 262 | CLANG_ENABLE_MODULES = YES; 263 | COMBINE_HIDPI_IMAGES = YES; 264 | DEFINES_MODULE = YES; 265 | DYLIB_COMPATIBILITY_VERSION = 1; 266 | DYLIB_CURRENT_VERSION = 1; 267 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 268 | FRAMEWORK_VERSION = A; 269 | INFOPLIST_FILE = ScriptingUtilities/Info.plist; 270 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 271 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 272 | PRODUCT_BUNDLE_IDENTIFIER = "com.majestysoftware.$(PRODUCT_NAME:rfc1034identifier)"; 273 | PRODUCT_NAME = "$(TARGET_NAME)"; 274 | SKIP_INSTALL = YES; 275 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 276 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 277 | SWIFT_VERSION = 4.0; 278 | }; 279 | name = Debug; 280 | }; 281 | E6981C7B1A86F52B0097ED59 /* Release */ = { 282 | isa = XCBuildConfiguration; 283 | buildSettings = { 284 | CLANG_ENABLE_MODULES = YES; 285 | COMBINE_HIDPI_IMAGES = YES; 286 | DEFINES_MODULE = YES; 287 | DYLIB_COMPATIBILITY_VERSION = 1; 288 | DYLIB_CURRENT_VERSION = 1; 289 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 290 | FRAMEWORK_VERSION = A; 291 | INFOPLIST_FILE = ScriptingUtilities/Info.plist; 292 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 293 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 294 | PRODUCT_BUNDLE_IDENTIFIER = "com.majestysoftware.$(PRODUCT_NAME:rfc1034identifier)"; 295 | PRODUCT_NAME = "$(TARGET_NAME)"; 296 | SKIP_INSTALL = YES; 297 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 298 | SWIFT_VERSION = 4.0; 299 | }; 300 | name = Release; 301 | }; 302 | /* End XCBuildConfiguration section */ 303 | 304 | /* Begin XCConfigurationList section */ 305 | E6981C5D1A86F52B0097ED59 /* Build configuration list for PBXProject "ScriptingUtilities" */ = { 306 | isa = XCConfigurationList; 307 | buildConfigurations = ( 308 | E6981C771A86F52B0097ED59 /* Debug */, 309 | E6981C781A86F52B0097ED59 /* Release */, 310 | ); 311 | defaultConfigurationIsVisible = 0; 312 | defaultConfigurationName = Release; 313 | }; 314 | E6981C791A86F52B0097ED59 /* Build configuration list for PBXNativeTarget "ScriptingUtilities" */ = { 315 | isa = XCConfigurationList; 316 | buildConfigurations = ( 317 | E6981C7A1A86F52B0097ED59 /* Debug */, 318 | E6981C7B1A86F52B0097ED59 /* Release */, 319 | ); 320 | defaultConfigurationIsVisible = 0; 321 | defaultConfigurationName = Release; 322 | }; 323 | /* End XCConfigurationList section */ 324 | }; 325 | rootObject = E6981C5A1A86F52B0097ED59 /* Project object */; 326 | } 327 | -------------------------------------------------------------------------------- /Frameworks/ScriptingUtilities/ScriptingUtilities.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Frameworks/ScriptingUtilities/ScriptingUtilities/AppUtilities.swift: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 Majesty Software. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | // 21 | 22 | import Foundation 23 | import ScriptingBridge 24 | 25 | public let defaultAppLocations = [ 26 | "/Applications", 27 | "/Applications/Utilities", 28 | "/System/Library/CoreServices", 29 | "/System/Applications", 30 | "/System/Applications/Utilities" 31 | ] 32 | 33 | public func appPathForName(_ name: String, locations: [String] = defaultAppLocations) -> String? { 34 | var path: String? 35 | for location in locations { 36 | let possiblePath = "\(location)/\(name).app" 37 | var isDirectory = ObjCBool(false) 38 | if FileManager.default.fileExists(atPath: possiblePath, isDirectory: &isDirectory) && isDirectory.boolValue { 39 | path = possiblePath 40 | break 41 | } 42 | } 43 | 44 | return path 45 | } 46 | 47 | public func application(bundleIdentifier: String) -> AnyObject? { 48 | return SBApplication(bundleIdentifier: bundleIdentifier) 49 | } 50 | 51 | public func application(path: String) -> AnyObject? { 52 | var app: AnyObject? 53 | if let bundle = Bundle(path: path) { 54 | app = application(bundleIdentifier: bundle.bundleIdentifier!) 55 | } 56 | 57 | return app 58 | } 59 | 60 | public func application(name: String, locations: [String] = defaultAppLocations) -> AnyObject? { 61 | var app: AnyObject? 62 | if let path = appPathForName(name, locations: locations) { 63 | app = application(path: path) 64 | } 65 | 66 | return app 67 | } 68 | 69 | public func objectWithApplication(_ application: AnyObject, scriptingClass: String, properties: [AnyHashable: Any] = [:]) -> SBObject! { 70 | let theClass = (application as! SBApplication).class(forScriptingClass: scriptingClass) as! SBObject.Type 71 | return theClass.init(properties: properties) 72 | } 73 | 74 | public func objectWithApplication(_ application: AnyObject, scriptingClass: T, properties: [AnyHashable: Any] = [:]) -> SBObject! { 75 | return objectWithApplication(application, scriptingClass: (scriptingClass.rawValue as! String), properties: properties) 76 | } 77 | -------------------------------------------------------------------------------- /Frameworks/ScriptingUtilities/ScriptingUtilities/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2015 Majesty Software. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Frameworks/ScriptingUtilities/ScriptingUtilities/ScriptingUtilities.h: -------------------------------------------------------------------------------- 1 | // 2 | // ScriptingUtilities.h 3 | // ScriptingUtilities 4 | // 5 | // Copyright (c) 2015 Majesty Software. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | //! Project version number for ScriptingUtilities. 29 | FOUNDATION_EXPORT double ScriptingUtilitiesVersionNumber; 30 | 31 | //! Project version string for ScriptingUtilities. 32 | FOUNDATION_EXPORT const unsigned char ScriptingUtilitiesVersionString[]; 33 | 34 | // In this header, you should import all the public headers of your framework using statements like #import 35 | -------------------------------------------------------------------------------- /Frameworks/ScriptingUtilities/ScriptingUtilities/SundryUtilities.swift: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 Majesty Software. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy 4 | // of this software and associated documentation files (the "Software"), to deal 5 | // in the Software without restriction, including without limitation the rights 6 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | // copies of the Software, and to permit persons to whom the Software is 8 | // furnished to do so, subject to the following conditions: 9 | // 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // 13 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | // THE SOFTWARE. 20 | // 21 | 22 | import Foundation 23 | 24 | public func runScript(_ script: String) { 25 | Process.launchedProcess(launchPath: "/usr/bin/osascript", arguments: ["-e", script]) 26 | } 27 | 28 | public func notifyUserWithMessage(_ message: String, title: String) { 29 | let script = "display notification \"\(message)\" with title \"\(title)\"" 30 | runScript(script) 31 | } 32 | 33 | public func commandOutput(_ commandPath: String, withArguments arguments: [String]? = nil, currentDirectoryPath: String? = nil) -> String? { 34 | let process = Process() 35 | let pipe = Pipe() 36 | process.standardOutput = pipe.fileHandleForWriting 37 | process.launchPath = commandPath 38 | if currentDirectoryPath != nil { 39 | process.currentDirectoryPath = currentDirectoryPath! 40 | } 41 | if arguments != nil { 42 | process.arguments = arguments! 43 | } 44 | process.launch() 45 | process.waitUntilExit() 46 | pipe.fileHandleForWriting.closeFile() 47 | return NSString(data: pipe.fileHandleForReading.availableData, encoding: String.Encoding.utf8.rawValue) as String? 48 | } 49 | -------------------------------------------------------------------------------- /Frameworks/SystemEventsScripting/SystemEventsScripting.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Frameworks/SystemEventsScripting/SystemEventsScripting/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2015 Majesty Software. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Frameworks/SystemEventsScripting/SystemEventsScripting/SystemEventsScripting.h: -------------------------------------------------------------------------------- 1 | // 2 | // SystemEventsScripting.h 3 | // SystemEventsScripting 4 | // 5 | // Copyright (c) 2015 Majesty Software. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | //! Project version number for SystemEventsScripting. 29 | FOUNDATION_EXPORT double SystemEventsScriptingVersionNumber; 30 | 31 | //! Project version string for SystemEventsScripting. 32 | FOUNDATION_EXPORT const unsigned char SystemEventsScriptingVersionString[]; 33 | 34 | // In this header, you should import all the public headers of your framework using statements like #import 35 | -------------------------------------------------------------------------------- /Frameworks/SystemEventsScripting/SystemEventsScripting/SystemEventsScripting.swift: -------------------------------------------------------------------------------- 1 | public enum SystemEventsScripting: String { 2 | case cdAndDvdPreferencesObject = "CD and DVD preferences object" 3 | case classicDomainObject = "Classic domain object" 4 | case quicktimeData = "QuickTime data" 5 | case quicktimeFile = "QuickTime file" 6 | case uiElement = "UI element" 7 | case xmlAttribute = "XML attribute" 8 | case xmlData = "XML data" 9 | case xmlElement = "XML element" 10 | case xmlFile = "XML file" 11 | case action = "action" 12 | case alias = "alias" 13 | case annotation = "annotation" 14 | case appearancePreferencesObject = "appearance preferences object" 15 | case applicationProcess = "application process" 16 | case application = "application" 17 | case attribute = "attribute" 18 | case audioData = "audio data" 19 | case audioFile = "audio file" 20 | case browser = "browser" 21 | case busyIndicator = "busy indicator" 22 | case button = "button" 23 | case checkbox = "checkbox" 24 | case colorWell = "color well" 25 | case column = "column" 26 | case comboBox = "combo box" 27 | case configuration = "configuration" 28 | case data = "data" 29 | case deskAccessoryProcess = "desk accessory process" 30 | case desktop = "desktop" 31 | case diskItem = "disk item" 32 | case disk = "disk" 33 | case dockPreferencesObject = "dock preferences object" 34 | case domain = "domain" 35 | case drawer = "drawer" 36 | case filePackage = "file package" 37 | case file = "file" 38 | case folderAction = "folder action" 39 | case folder = "folder" 40 | case group = "group" 41 | case growArea = "grow area" 42 | case image = "image" 43 | case incrementor = "incrementor" 44 | case insertionPreference = "insertion preference" 45 | case interface = "interface" 46 | case list = "list" 47 | case localDomainObject = "local domain object" 48 | case location = "location" 49 | case loginItem = "login item" 50 | case menuBarItem = "menu bar item" 51 | case menuBar = "menu bar" 52 | case menuButton = "menu button" 53 | case menuItem = "menu item" 54 | case menu = "menu" 55 | case movieData = "movie data" 56 | case movieFile = "movie file" 57 | case networkDomainObject = "network domain object" 58 | case networkPreferencesObject = "network preferences object" 59 | case outline = "outline" 60 | case popOver = "pop over" 61 | case popUpButton = "pop up button" 62 | case printSettings = "print settings" 63 | case process = "process" 64 | case progressIndicator = "progress indicator" 65 | case propertyListFile = "property list file" 66 | case propertyListItem = "property list item" 67 | case radioButton = "radio button" 68 | case radioGroup = "radio group" 69 | case relevanceIndicator = "relevance indicator" 70 | case row = "row" 71 | case screenSaverPreferencesObject = "screen saver preferences object" 72 | case screenSaver = "screen saver" 73 | case script = "script" 74 | case scriptingClass = "scripting class" 75 | case scriptingCommand = "scripting command" 76 | case scriptingDefinitionObject = "scripting definition object" 77 | case scriptingElement = "scripting element" 78 | case scriptingEnumeration = "scripting enumeration" 79 | case scriptingEnumerator = "scripting enumerator" 80 | case scriptingParameter = "scripting parameter" 81 | case scriptingProperty = "scripting property" 82 | case scriptingResultObject = "scripting result object" 83 | case scriptingSuite = "scripting suite" 84 | case scrollArea = "scroll area" 85 | case scrollBar = "scroll bar" 86 | case securityPreferencesObject = "security preferences object" 87 | case service = "service" 88 | case sheet = "sheet" 89 | case slider = "slider" 90 | case splitterGroup = "splitter group" 91 | case splitter = "splitter" 92 | case staticText = "static text" 93 | case systemDomainObject = "system domain object" 94 | case tabGroup = "tab group" 95 | case table = "table" 96 | case textArea = "text area" 97 | case textField = "text field" 98 | case toolbar = "toolbar" 99 | case track = "track" 100 | case userDomainObject = "user domain object" 101 | case user = "user" 102 | case valueIndicator = "value indicator" 103 | case window = "window" 104 | } 105 | -------------------------------------------------------------------------------- /Frameworks/SystemPreferencesScripting/SystemPreferencesScripting.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Frameworks/SystemPreferencesScripting/SystemPreferencesScripting/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2015 Majesty Software. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Frameworks/SystemPreferencesScripting/SystemPreferencesScripting/SystemPreferences.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SystemPreferences.h 3 | */ 4 | 5 | #import 6 | #import 7 | 8 | 9 | @class SystemPreferencesApplication, SystemPreferencesDocument, SystemPreferencesWindow, SystemPreferencesPane, SystemPreferencesAnchor; 10 | 11 | enum SystemPreferencesSaveOptions { 12 | SystemPreferencesSaveOptionsYes = 'yes ' /* Save the file. */, 13 | SystemPreferencesSaveOptionsNo = 'no ' /* Do not save the file. */, 14 | SystemPreferencesSaveOptionsAsk = 'ask ' /* Ask the user whether or not to save the file. */ 15 | }; 16 | typedef enum SystemPreferencesSaveOptions SystemPreferencesSaveOptions; 17 | 18 | enum SystemPreferencesPrintingErrorHandling { 19 | SystemPreferencesPrintingErrorHandlingStandard = 'lwst' /* Standard PostScript error handling */, 20 | SystemPreferencesPrintingErrorHandlingDetailed = 'lwdt' /* print a detailed report of PostScript errors */ 21 | }; 22 | typedef enum SystemPreferencesPrintingErrorHandling SystemPreferencesPrintingErrorHandling; 23 | 24 | @protocol SystemPreferencesGenericMethods 25 | 26 | - (void) closeSaving:(SystemPreferencesSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document. 27 | - (void) printWithProperties:(NSDictionary *)withProperties printDialog:(BOOL)printDialog; // Print a document. 28 | 29 | @end 30 | 31 | 32 | 33 | /* 34 | * Standard Suite 35 | */ 36 | 37 | // The application's top-level scripting object. 38 | @interface SystemPreferencesApplication : SBApplication 39 | 40 | - (SBElementArray *) documents; 41 | - (SBElementArray *) windows; 42 | 43 | @property (copy, readonly) NSString *name; // The name of the application. 44 | @property (readonly) BOOL frontmost; // Is this the active application? 45 | @property (copy, readonly) NSString *version; // The version number of the application. 46 | 47 | - (id) open:(id)x; // Open a document. 48 | - (void) print:(id)x withProperties:(NSDictionary *)withProperties printDialog:(BOOL)printDialog; // Print a document. 49 | - (void) quitSaving:(SystemPreferencesSaveOptions)saving; // Quit the application. 50 | - (BOOL) exists:(id)x; // Verify that an object exists. 51 | 52 | @end 53 | 54 | // A document. 55 | @interface SystemPreferencesDocument : SBObject 56 | 57 | @property (copy, readonly) NSString *name; // Its name. 58 | @property (readonly) BOOL modified; // Has it been modified since the last save? 59 | @property (copy, readonly) NSURL *file; // Its location on disk, if it has one. 60 | 61 | 62 | @end 63 | 64 | // A window. 65 | @interface SystemPreferencesWindow : SBObject 66 | 67 | @property (copy, readonly) NSString *name; // The title of the window. 68 | - (NSInteger) id; // The unique identifier of the window. 69 | @property NSInteger index; // The index of the window, ordered front to back. 70 | @property NSRect bounds; // The bounding rectangle of the window. 71 | @property (readonly) BOOL closeable; // Does the window have a close button? 72 | @property (readonly) BOOL miniaturizable; // Does the window have a minimize button? 73 | @property BOOL miniaturized; // Is the window minimized right now? 74 | @property (readonly) BOOL resizable; // Can the window be resized? 75 | @property BOOL visible; // Is the window visible right now? 76 | @property (readonly) BOOL zoomable; // Does the window have a zoom button? 77 | @property BOOL zoomed; // Is the window zoomed right now? 78 | @property (copy, readonly) SystemPreferencesDocument *document; // The document whose contents are displayed in the window. 79 | 80 | 81 | @end 82 | 83 | 84 | 85 | /* 86 | * System Preferences 87 | */ 88 | 89 | // System Preferences top level scripting object 90 | @interface SystemPreferencesApplication (SystemPreferences) 91 | 92 | - (SBElementArray *) panes; 93 | 94 | @property (copy) SystemPreferencesPane *currentPane; // the currently selected pane 95 | @property (copy, readonly) SystemPreferencesWindow *preferencesWindow; // the main preferences window 96 | @property BOOL showAll; // Is SystemPrefs in show all view. (Setting to false will do nothing) 97 | 98 | @end 99 | 100 | // a preference pane 101 | @interface SystemPreferencesPane : SBObject 102 | 103 | - (SBElementArray *) anchors; 104 | 105 | - (NSString *) id; // locale independent name of the preference pane; can refer to a pane using the expression: pane id "" 106 | @property (copy, readonly) NSString *localizedName; // localized name of the preference pane 107 | @property (copy, readonly) NSString *name; // name of the preference pane as it appears in the title bar; can refer to a pane using the expression: pane "" 108 | 109 | - (id) reveal; // Reveals an anchor within a preference pane or preference pane itself 110 | - (SystemPreferencesPane *) authorize; // Prompt authorization for given preference pane 111 | 112 | @end 113 | 114 | // an anchor within a preference pane 115 | @interface SystemPreferencesAnchor : SBObject 116 | 117 | @property (copy, readonly) NSString *name; // name of the anchor within a preference pane 118 | 119 | - (id) reveal; // Reveals an anchor within a preference pane or preference pane itself 120 | 121 | @end 122 | 123 | -------------------------------------------------------------------------------- /Frameworks/SystemPreferencesScripting/SystemPreferencesScripting/SystemPreferences.sdef: -------------------------------------------------------------------------------- 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 | 39 | 40 | 41 | 42 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /Frameworks/SystemPreferencesScripting/SystemPreferencesScripting/SystemPreferences.swift: -------------------------------------------------------------------------------- 1 | import AppKit 2 | import ScriptingBridge 3 | 4 | @objc public protocol SBObjectProtocol: NSObjectProtocol { 5 | func get() -> Any! 6 | } 7 | 8 | @objc public protocol SBApplicationProtocol: SBObjectProtocol { 9 | func activate() 10 | var delegate: SBApplicationDelegate! { get set } 11 | var isRunning: Bool { get } 12 | } 13 | 14 | // MARK: SystemPreferencesSaveOptions 15 | @objc public enum SystemPreferencesSaveOptions : AEKeyword { 16 | case yes = 0x79657320 /* 'yes ' */ 17 | case no = 0x6e6f2020 /* 'no ' */ 18 | case ask = 0x61736b20 /* 'ask ' */ 19 | } 20 | 21 | // MARK: SystemPreferencesPrintingErrorHandling 22 | @objc public enum SystemPreferencesPrintingErrorHandling : AEKeyword { 23 | case standard = 0x6c777374 /* 'lwst' */ 24 | case detailed = 0x6c776474 /* 'lwdt' */ 25 | } 26 | 27 | // MARK: SystemPreferencesGenericMethods 28 | @objc public protocol SystemPreferencesGenericMethods { 29 | @objc optional func closeSaving(_ saving: SystemPreferencesSaveOptions, savingIn: URL!) // Close a document. 30 | @objc optional func printWithProperties(_ withProperties: [AnyHashable : Any]!, printDialog: Bool) // Print a document. 31 | } 32 | 33 | // MARK: SystemPreferencesApplication 34 | @objc public protocol SystemPreferencesApplication: SBApplicationProtocol { 35 | @objc optional func documents() -> SBElementArray 36 | @objc optional func windows() -> SBElementArray 37 | @objc optional var name: String { get } // The name of the application. 38 | @objc optional var frontmost: Bool { get } // Is this the active application? 39 | @objc optional var version: String { get } // The version number of the application. 40 | @objc optional func `open`(_ x: Any!) -> Any // Open a document. 41 | @objc optional func print(_ x: Any!, withProperties: [AnyHashable : Any]!, printDialog: Bool) // Print a document. 42 | @objc optional func quitSaving(_ saving: SystemPreferencesSaveOptions) // Quit the application. 43 | @objc optional func exists(_ x: Any!) -> Bool // Verify that an object exists. 44 | @objc optional func panes() -> SBElementArray 45 | @objc optional var currentPane: SystemPreferencesPane { get } // the currently selected pane 46 | @objc optional var preferencesWindow: SystemPreferencesWindow { get } // the main preferences window 47 | @objc optional var showAll: Bool { get } // Is SystemPrefs in show all view. (Setting to false will do nothing) 48 | @objc optional func setCurrentPane(_ currentPane: SystemPreferencesPane!) // the currently selected pane 49 | @objc optional func setShowAll(_ showAll: Bool) // Is SystemPrefs in show all view. (Setting to false will do nothing) 50 | } 51 | extension SBApplication: SystemPreferencesApplication {} 52 | 53 | // MARK: SystemPreferencesDocument 54 | @objc public protocol SystemPreferencesDocument: SBObjectProtocol, SystemPreferencesGenericMethods { 55 | @objc optional var name: String { get } // Its name. 56 | @objc optional var modified: Bool { get } // Has it been modified since the last save? 57 | @objc optional var file: URL { get } // Its location on disk, if it has one. 58 | } 59 | extension SBObject: SystemPreferencesDocument {} 60 | 61 | // MARK: SystemPreferencesWindow 62 | @objc public protocol SystemPreferencesWindow: SBObjectProtocol, SystemPreferencesGenericMethods { 63 | @objc optional var name: String { get } // The title of the window. 64 | @objc optional func id() -> Int // The unique identifier of the window. 65 | @objc optional var index: Int { get } // The index of the window, ordered front to back. 66 | @objc optional var bounds: NSRect { get } // The bounding rectangle of the window. 67 | @objc optional var closeable: Bool { get } // Does the window have a close button? 68 | @objc optional var miniaturizable: Bool { get } // Does the window have a minimize button? 69 | @objc optional var miniaturized: Bool { get } // Is the window minimized right now? 70 | @objc optional var resizable: Bool { get } // Can the window be resized? 71 | @objc optional var visible: Bool { get } // Is the window visible right now? 72 | @objc optional var zoomable: Bool { get } // Does the window have a zoom button? 73 | @objc optional var zoomed: Bool { get } // Is the window zoomed right now? 74 | @objc optional var document: SystemPreferencesDocument { get } // The document whose contents are displayed in the window. 75 | @objc optional func setIndex(_ index: Int) // The index of the window, ordered front to back. 76 | @objc optional func setBounds(_ bounds: NSRect) // The bounding rectangle of the window. 77 | @objc optional func setMiniaturized(_ miniaturized: Bool) // Is the window minimized right now? 78 | @objc optional func setVisible(_ visible: Bool) // Is the window visible right now? 79 | @objc optional func setZoomed(_ zoomed: Bool) // Is the window zoomed right now? 80 | } 81 | extension SBObject: SystemPreferencesWindow {} 82 | 83 | // MARK: SystemPreferencesPane 84 | @objc public protocol SystemPreferencesPane: SBObjectProtocol, SystemPreferencesGenericMethods { 85 | @objc optional func anchors() -> SBElementArray 86 | @objc optional func id() -> String // locale independent name of the preference pane; can refer to a pane using the expression: pane id "" 87 | @objc optional var localizedName: String { get } // localized name of the preference pane 88 | @objc optional var name: String { get } // name of the preference pane as it appears in the title bar; can refer to a pane using the expression: pane "" 89 | @objc optional func reveal() -> Any // Reveals an anchor within a preference pane or preference pane itself 90 | @objc optional func authorize() -> SystemPreferencesPane // Prompt authorization for given preference pane 91 | } 92 | extension SBObject: SystemPreferencesPane {} 93 | 94 | // MARK: SystemPreferencesAnchor 95 | @objc public protocol SystemPreferencesAnchor: SBObjectProtocol, SystemPreferencesGenericMethods { 96 | @objc optional var name: String { get } // name of the anchor within a preference pane 97 | @objc optional func reveal() -> Any // Reveals an anchor within a preference pane or preference pane itself 98 | } 99 | extension SBObject: SystemPreferencesAnchor {} 100 | 101 | -------------------------------------------------------------------------------- /Frameworks/SystemPreferencesScripting/SystemPreferencesScripting/SystemPreferencesScripting.h: -------------------------------------------------------------------------------- 1 | // 2 | // SystemPreferencesScripting.h 3 | // SystemPreferencesScripting 4 | // 5 | // Copyright (c) 2015 Majesty Software. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | //! Project version number for SystemPreferencesScripting. 29 | FOUNDATION_EXPORT double SystemPreferencesScriptingVersionNumber; 30 | 31 | //! Project version string for SystemPreferencesScripting. 32 | FOUNDATION_EXPORT const unsigned char SystemPreferencesScriptingVersionString[]; 33 | 34 | // In this header, you should import all the public headers of your framework using statements like #import 35 | -------------------------------------------------------------------------------- /Frameworks/SystemPreferencesScripting/SystemPreferencesScripting/SystemPreferencesScripting.swift: -------------------------------------------------------------------------------- 1 | public enum SystemPreferencesScripting: String { 2 | case anchor = "anchor" 3 | case application = "application" 4 | case pane = "pane" 5 | } 6 | -------------------------------------------------------------------------------- /Frameworks/TerminalScripting/TerminalScripting.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Frameworks/TerminalScripting/TerminalScripting/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2015 Majesty Software. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Frameworks/TerminalScripting/TerminalScripting/Terminal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Terminal.h 3 | */ 4 | 5 | #import 6 | #import 7 | 8 | 9 | @class TerminalApplication, TerminalWindow, TerminalSettingsSet, TerminalTab; 10 | 11 | enum TerminalSaveOptions { 12 | TerminalSaveOptionsYes = 'yes ' /* Save the file. */, 13 | TerminalSaveOptionsNo = 'no ' /* Do not save the file. */, 14 | TerminalSaveOptionsAsk = 'ask ' /* Ask the user whether or not to save the file. */ 15 | }; 16 | typedef enum TerminalSaveOptions TerminalSaveOptions; 17 | 18 | enum TerminalPrintingErrorHandling { 19 | TerminalPrintingErrorHandlingStandard = 'lwst' /* Standard PostScript error handling */, 20 | TerminalPrintingErrorHandlingDetailed = 'lwdt' /* print a detailed report of PostScript errors */ 21 | }; 22 | typedef enum TerminalPrintingErrorHandling TerminalPrintingErrorHandling; 23 | 24 | @protocol TerminalGenericMethods 25 | 26 | - (void) closeSaving:(TerminalSaveOptions)saving savingIn:(NSURL *)savingIn; // Close a document. 27 | - (void) saveIn:(NSURL *)in_; // Save a document. 28 | - (void) printWithProperties:(NSDictionary *)withProperties printDialog:(BOOL)printDialog; // Print a document. 29 | - (void) delete; // Delete an object. 30 | - (void) duplicateTo:(SBObject *)to withProperties:(NSDictionary *)withProperties; // Copy object(s) and put the copies at a new location. 31 | - (BOOL) exists; // Verify if an object exists. 32 | - (void) moveTo:(SBObject *)to; // Move object(s) to a new location. 33 | 34 | @end 35 | 36 | 37 | 38 | /* 39 | * Standard Suite 40 | */ 41 | 42 | // The application‘s top-level scripting object. 43 | @interface TerminalApplication : SBApplication 44 | 45 | - (SBElementArray *) windows; 46 | 47 | @property (copy, readonly) NSString *name; // The name of the application. 48 | @property (readonly) BOOL frontmost; // Is this the frontmost (active) application? 49 | @property (copy, readonly) NSString *version; // The version of the application. 50 | 51 | - (void) open:(NSArray *)x; // Open a document. 52 | - (void) print:(id)x withProperties:(NSDictionary *)withProperties printDialog:(BOOL)printDialog; // Print a document. 53 | - (void) quitSaving:(TerminalSaveOptions)saving; // Quit the application. 54 | - (TerminalTab *) doScript:(NSString *)x in:(id)in_; // Runs a UNIX shell script or command. 55 | 56 | @end 57 | 58 | // A window. 59 | @interface TerminalWindow : SBObject 60 | 61 | - (SBElementArray *) tabs; 62 | 63 | @property (copy, readonly) NSString *name; // The full title of the window. 64 | - (NSInteger) id; // The unique identifier of the window. 65 | @property NSInteger index; // The index of the window, ordered front to back. 66 | @property NSRect bounds; // The bounding rectangle of the window. 67 | @property (readonly) BOOL closeable; // Whether the window has a close box. 68 | @property (readonly) BOOL miniaturizable; // Whether the window can be minimized. 69 | @property BOOL miniaturized; // Whether the window is currently minimized. 70 | @property (readonly) BOOL resizable; // Whether the window can be resized. 71 | @property BOOL visible; // Whether the window is currently visible. 72 | @property (readonly) BOOL zoomable; // Whether the window can be zoomed. 73 | @property BOOL zoomed; // Whether the window is currently zoomed. 74 | @property BOOL frontmost; // Whether the window is currently the frontmost Terminal window. 75 | @property (copy) TerminalTab *selectedTab; 76 | @property NSPoint position; // The position of the window, relative to the upper left corner of the screen. 77 | @property NSPoint origin; // The position of the window, relative to the lower left corner of the screen. 78 | @property NSPoint size; // The width and height of the window 79 | @property NSRect frame; // The bounding rectangle, relative to the lower left corner of the screen. 80 | 81 | 82 | @end 83 | 84 | 85 | 86 | /* 87 | * Terminal Suite 88 | */ 89 | 90 | @interface TerminalApplication (TerminalSuite) 91 | 92 | - (SBElementArray *) settingsSets; 93 | 94 | @property (copy) TerminalSettingsSet *defaultSettings; // The settings set used for new windows. 95 | @property (copy) TerminalSettingsSet *startupSettings; // The settings set used for the window created on application startup. 96 | 97 | @end 98 | 99 | // A set of settings. 100 | @interface TerminalSettingsSet : SBObject 101 | 102 | - (NSInteger) id; // The unique identifier of the settings set. 103 | @property (copy) NSString *name; // The name of the settings set. 104 | @property NSInteger numberOfRows; // The number of rows displayed in the tab. 105 | @property NSInteger numberOfColumns; // The number of columns displayed in the tab. 106 | @property (copy) NSColor *cursorColor; // The cursor color for the tab. 107 | @property (copy) NSColor *backgroundColor; // The background color for the tab. 108 | @property (copy) NSColor *normalTextColor; // The normal text color for the tab. 109 | @property (copy) NSColor *boldTextColor; // The bold text color for the tab. 110 | @property (copy) NSString *fontName; // The name of the font used to display the tab’s contents. 111 | @property NSInteger fontSize; // The size of the font used to display the tab’s contents. 112 | @property BOOL fontAntialiasing; // Whether the font used to display the tab’s contents is antialiased. 113 | @property (copy) NSArray *cleanCommands; // The processes which will be ignored when checking whether a tab can be closed without showing a prompt. 114 | @property BOOL titleDisplaysDeviceName; // Whether the title contains the device name. 115 | @property BOOL titleDisplaysShellPath; // Whether the title contains the shell path. 116 | @property BOOL titleDisplaysWindowSize; // Whether the title contains the tab’s size, in rows and columns. 117 | @property BOOL titleDisplaysSettingsName; // Whether the title contains the settings name. 118 | @property BOOL titleDisplaysCustomTitle; // Whether the title contains a custom title. 119 | @property (copy) NSString *customTitle; // The tab’s custom title. 120 | 121 | 122 | @end 123 | 124 | // A tab. 125 | @interface TerminalTab : SBObject 126 | 127 | @property NSInteger numberOfRows; // The number of rows displayed in the tab. 128 | @property NSInteger numberOfColumns; // The number of columns displayed in the tab. 129 | @property (copy, readonly) NSString *contents; // The currently visible contents of the tab. 130 | @property (copy, readonly) NSString *history; // The contents of the entire scrolling buffer of the tab. 131 | @property (readonly) BOOL busy; // Whether the tab is busy running a process. 132 | @property (copy, readonly) NSArray *processes; // The processes currently running in the tab. 133 | @property BOOL selected; // Whether the tab is selected. 134 | @property BOOL titleDisplaysCustomTitle; // Whether the title contains a custom title. 135 | @property (copy) NSString *customTitle; // The tab’s custom title. 136 | @property (copy, readonly) NSString *tty; // The tab’s TTY device. 137 | @property (copy) TerminalSettingsSet *currentSettings; // The set of settings which control the tab’s behavior and appearance. 138 | @property (copy) NSColor *cursorColor; // The cursor color for the tab. 139 | @property (copy) NSColor *backgroundColor; // The background color for the tab. 140 | @property (copy) NSColor *normalTextColor; // The normal text color for the tab. 141 | @property (copy) NSColor *boldTextColor; // The bold text color for the tab. 142 | @property (copy) NSArray *cleanCommands; // The processes which will be ignored when checking whether a tab can be closed without showing a prompt. 143 | @property BOOL titleDisplaysDeviceName; // Whether the title contains the device name. 144 | @property BOOL titleDisplaysShellPath; // Whether the title contains the shell path. 145 | @property BOOL titleDisplaysWindowSize; // Whether the title contains the tab’s size, in rows and columns. 146 | @property BOOL titleDisplaysFileName; // Whether the title contains the file name. 147 | @property (copy) NSString *fontName; // The name of the font used to display the tab’s contents. 148 | @property NSInteger fontSize; // The size of the font used to display the tab’s contents. 149 | @property BOOL fontAntialiasing; // Whether the font used to display the tab’s contents is antialiased. 150 | 151 | 152 | @end 153 | 154 | -------------------------------------------------------------------------------- /Frameworks/TerminalScripting/TerminalScripting/TerminalScripting.h: -------------------------------------------------------------------------------- 1 | // 2 | // TerminalScripting.h 3 | // TerminalScripting 4 | // 5 | // Copyright (c) 2015 Majesty Software. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | //! Project version number for TerminalScripting. 29 | FOUNDATION_EXPORT double TerminalScriptingVersionNumber; 30 | 31 | //! Project version string for TerminalScripting. 32 | FOUNDATION_EXPORT const unsigned char TerminalScriptingVersionString[]; 33 | 34 | // In this header, you should import all the public headers of your framework using statements like #import 35 | -------------------------------------------------------------------------------- /Frameworks/TerminalScripting/TerminalScripting/TerminalScripting.swift: -------------------------------------------------------------------------------- 1 | public enum TerminalScripting: String { 2 | case application = "application" 3 | case settingsSet = "settings set" 4 | case tab = "tab" 5 | case window = "window" 6 | } 7 | -------------------------------------------------------------------------------- /Frameworks/TextWranglerScripting/TextWranglerScripting.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Frameworks/TextWranglerScripting/TextWranglerScripting/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2015 Majesty Software. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Frameworks/TextWranglerScripting/TextWranglerScripting/TextWranglerScripting.h: -------------------------------------------------------------------------------- 1 | // 2 | // TextWranglerScripting.h 3 | // TextWranglerScripting 4 | // 5 | // Copyright (c) 2015 Majesty Software. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | //! Project version number for TextWranglerScripting. 29 | FOUNDATION_EXPORT double TextWranglerScriptingVersionNumber; 30 | 31 | //! Project version string for TextWranglerScripting. 32 | FOUNDATION_EXPORT const unsigned char TextWranglerScriptingVersionString[]; 33 | 34 | // In this header, you should import all the public headers of your framework using statements like #import 35 | -------------------------------------------------------------------------------- /Frameworks/TextWranglerScripting/TextWranglerScripting/TextWranglerScripting.swift: -------------------------------------------------------------------------------- 1 | public enum TextWranglerScripting: String { 2 | case compareOptions = "Compare Options" 3 | case compareResults = "Compare Results" 4 | case ftpInfo = "FTP Info" 5 | case ftpBrowserWindow = "FTP browser window" 6 | case markOptions = "Mark Options" 7 | case processDuplicatesOptions = "Process Duplicates Options" 8 | case processDuplicatesOutputOptions = "Process Duplicates Output Options" 9 | case processDuplicatesResults = "Process Duplicates Results" 10 | case processLinesContainingOutputOptions = "Process Lines Containing Output Options" 11 | case processLinesContainingResults = "Process Lines Containing Results" 12 | case resultEntry = "Result Entry" 13 | case searchMatch = "Search Match" 14 | case searchOptions = "Search Options" 15 | case searchStringProperties = "Search String Properties" 16 | case sortLinesOptions = "Sort Lines Options" 17 | case sortLinesOutputOptions = "Sort Lines Output Options" 18 | case application = "application" 19 | case character = "character" 20 | case clipboard = "clipboard" 21 | case differences_window = "differences_window" 22 | case diskBrowserWindow = "disk browser window" 23 | case display_line = "display_line" 24 | case document = "document" 25 | case file = "file" 26 | case filter = "filter" 27 | case filter_term = "filter_term" 28 | case find_window = "find_window" 29 | case imageDocument = "image document" 30 | case imageWindow = "image window" 31 | case insertionPoint = "insertion point" 32 | case item = "item" 33 | case line = "line" 34 | case multifile_differences_window = "multifile_differences_window" 35 | case multifile_search_window = "multifile_search_window" 36 | case open_file_by_name_window = "open_file_by_name_window" 37 | case palette = "palette" 38 | case perl_reference_window = "perl_reference_window" 39 | case plugin_info_window = "plugin_info_window" 40 | case preferences_window = "preferences_window" 41 | case printSettings = "print settings" 42 | case projectWindow = "project window" 43 | case resultsBrowser = "results browser" 44 | case scratchpad_window = "scratchpad_window" 45 | case searchResultsBrowser = "search results browser" 46 | case shellDocument = "shell document" 47 | case shellWindow = "shell window" 48 | case textDocument = "text document" 49 | case textWindow = "text window" 50 | case text = "text" 51 | case text_object = "text_object" 52 | case window = "window" 53 | case word = "word" 54 | } 55 | -------------------------------------------------------------------------------- /Frameworks/XcodeScripting/XcodeScripting.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | E691CDAF1A65564B005FF12F /* XcodeScripting.h in Headers */ = {isa = PBXBuildFile; fileRef = E691CDAE1A65564B005FF12F /* XcodeScripting.h */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | E6C82BE11A886A8B002D55A2 /* Xcode.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6C82BDE1A886A8B002D55A2 /* Xcode.swift */; }; 12 | E6D7AE891AABF6CE00E8E744 /* XcodeScripting.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6D7AE881AABF6CE00E8E744 /* XcodeScripting.swift */; }; 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXFileReference section */ 16 | E691CDA91A65564B005FF12F /* XcodeScripting.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = XcodeScripting.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 17 | E691CDAD1A65564B005FF12F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 18 | E691CDAE1A65564B005FF12F /* XcodeScripting.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XcodeScripting.h; sourceTree = ""; }; 19 | E691CDC51A65565A005FF12F /* Xcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Xcode.h; sourceTree = ""; }; 20 | E6C82BDD1A886A8B002D55A2 /* Xcode.sdef */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = Xcode.sdef; sourceTree = ""; }; 21 | E6C82BDE1A886A8B002D55A2 /* Xcode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Xcode.swift; sourceTree = ""; }; 22 | E6D7AE881AABF6CE00E8E744 /* XcodeScripting.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XcodeScripting.swift; sourceTree = ""; }; 23 | /* End PBXFileReference section */ 24 | 25 | /* Begin PBXFrameworksBuildPhase section */ 26 | E691CDA51A65564B005FF12F /* Frameworks */ = { 27 | isa = PBXFrameworksBuildPhase; 28 | buildActionMask = 2147483647; 29 | files = ( 30 | ); 31 | runOnlyForDeploymentPostprocessing = 0; 32 | }; 33 | /* End PBXFrameworksBuildPhase section */ 34 | 35 | /* Begin PBXGroup section */ 36 | E691CD9F1A65564B005FF12F = { 37 | isa = PBXGroup; 38 | children = ( 39 | E691CDAB1A65564B005FF12F /* XcodeScripting */, 40 | E691CDAA1A65564B005FF12F /* Products */, 41 | ); 42 | sourceTree = ""; 43 | }; 44 | E691CDAA1A65564B005FF12F /* Products */ = { 45 | isa = PBXGroup; 46 | children = ( 47 | E691CDA91A65564B005FF12F /* XcodeScripting.framework */, 48 | ); 49 | name = Products; 50 | sourceTree = ""; 51 | }; 52 | E691CDAB1A65564B005FF12F /* XcodeScripting */ = { 53 | isa = PBXGroup; 54 | children = ( 55 | E6C82BE31A886A8F002D55A2 /* ObjC Header */, 56 | E6C82BDE1A886A8B002D55A2 /* Xcode.swift */, 57 | E691CDAE1A65564B005FF12F /* XcodeScripting.h */, 58 | E6D7AE881AABF6CE00E8E744 /* XcodeScripting.swift */, 59 | E691CDAC1A65564B005FF12F /* Supporting Files */, 60 | ); 61 | path = XcodeScripting; 62 | sourceTree = ""; 63 | }; 64 | E691CDAC1A65564B005FF12F /* Supporting Files */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | E691CDAD1A65564B005FF12F /* Info.plist */, 68 | ); 69 | name = "Supporting Files"; 70 | sourceTree = ""; 71 | }; 72 | E6C82BE31A886A8F002D55A2 /* ObjC Header */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | E691CDC51A65565A005FF12F /* Xcode.h */, 76 | E6C82BDD1A886A8B002D55A2 /* Xcode.sdef */, 77 | ); 78 | name = "ObjC Header"; 79 | sourceTree = ""; 80 | }; 81 | /* End PBXGroup section */ 82 | 83 | /* Begin PBXHeadersBuildPhase section */ 84 | E691CDA61A65564B005FF12F /* Headers */ = { 85 | isa = PBXHeadersBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | E691CDAF1A65564B005FF12F /* XcodeScripting.h in Headers */, 89 | ); 90 | runOnlyForDeploymentPostprocessing = 0; 91 | }; 92 | /* End PBXHeadersBuildPhase section */ 93 | 94 | /* Begin PBXNativeTarget section */ 95 | E691CDA81A65564B005FF12F /* XcodeScripting */ = { 96 | isa = PBXNativeTarget; 97 | buildConfigurationList = E691CDBF1A65564B005FF12F /* Build configuration list for PBXNativeTarget "XcodeScripting" */; 98 | buildPhases = ( 99 | E691CDA41A65564B005FF12F /* Sources */, 100 | E691CDA51A65564B005FF12F /* Frameworks */, 101 | E691CDA61A65564B005FF12F /* Headers */, 102 | E691CDA71A65564B005FF12F /* Resources */, 103 | ); 104 | buildRules = ( 105 | ); 106 | dependencies = ( 107 | ); 108 | name = XcodeScripting; 109 | productName = XcodeScripting; 110 | productReference = E691CDA91A65564B005FF12F /* XcodeScripting.framework */; 111 | productType = "com.apple.product-type.framework"; 112 | }; 113 | /* End PBXNativeTarget section */ 114 | 115 | /* Begin PBXProject section */ 116 | E691CDA01A65564B005FF12F /* Project object */ = { 117 | isa = PBXProject; 118 | attributes = { 119 | LastSwiftUpdateCheck = 0700; 120 | LastUpgradeCheck = 0910; 121 | ORGANIZATIONNAME = "Majesty Software"; 122 | TargetAttributes = { 123 | E691CDA81A65564B005FF12F = { 124 | CreatedOnToolsVersion = 6.1.1; 125 | LastSwiftMigration = 0910; 126 | }; 127 | }; 128 | }; 129 | buildConfigurationList = E691CDA31A65564B005FF12F /* Build configuration list for PBXProject "XcodeScripting" */; 130 | compatibilityVersion = "Xcode 3.2"; 131 | developmentRegion = English; 132 | hasScannedForEncodings = 0; 133 | knownRegions = ( 134 | en, 135 | ); 136 | mainGroup = E691CD9F1A65564B005FF12F; 137 | productRefGroup = E691CDAA1A65564B005FF12F /* Products */; 138 | projectDirPath = ""; 139 | projectRoot = ""; 140 | targets = ( 141 | E691CDA81A65564B005FF12F /* XcodeScripting */, 142 | ); 143 | }; 144 | /* End PBXProject section */ 145 | 146 | /* Begin PBXResourcesBuildPhase section */ 147 | E691CDA71A65564B005FF12F /* Resources */ = { 148 | isa = PBXResourcesBuildPhase; 149 | buildActionMask = 2147483647; 150 | files = ( 151 | ); 152 | runOnlyForDeploymentPostprocessing = 0; 153 | }; 154 | /* End PBXResourcesBuildPhase section */ 155 | 156 | /* Begin PBXSourcesBuildPhase section */ 157 | E691CDA41A65564B005FF12F /* Sources */ = { 158 | isa = PBXSourcesBuildPhase; 159 | buildActionMask = 2147483647; 160 | files = ( 161 | E6C82BE11A886A8B002D55A2 /* Xcode.swift in Sources */, 162 | E6D7AE891AABF6CE00E8E744 /* XcodeScripting.swift in Sources */, 163 | ); 164 | runOnlyForDeploymentPostprocessing = 0; 165 | }; 166 | /* End PBXSourcesBuildPhase section */ 167 | 168 | /* Begin XCBuildConfiguration section */ 169 | E691CDBD1A65564B005FF12F /* Debug */ = { 170 | isa = XCBuildConfiguration; 171 | buildSettings = { 172 | ALWAYS_SEARCH_USER_PATHS = NO; 173 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 174 | CLANG_CXX_LIBRARY = "libc++"; 175 | CLANG_ENABLE_MODULES = YES; 176 | CLANG_ENABLE_OBJC_ARC = YES; 177 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 178 | CLANG_WARN_BOOL_CONVERSION = YES; 179 | CLANG_WARN_COMMA = YES; 180 | CLANG_WARN_CONSTANT_CONVERSION = YES; 181 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 182 | CLANG_WARN_EMPTY_BODY = YES; 183 | CLANG_WARN_ENUM_CONVERSION = YES; 184 | CLANG_WARN_INFINITE_RECURSION = YES; 185 | CLANG_WARN_INT_CONVERSION = YES; 186 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 187 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 188 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 189 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 190 | CLANG_WARN_STRICT_PROTOTYPES = YES; 191 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 192 | CLANG_WARN_UNREACHABLE_CODE = YES; 193 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 194 | COPY_PHASE_STRIP = NO; 195 | CURRENT_PROJECT_VERSION = 1; 196 | ENABLE_STRICT_OBJC_MSGSEND = YES; 197 | ENABLE_TESTABILITY = YES; 198 | GCC_C_LANGUAGE_STANDARD = gnu99; 199 | GCC_DYNAMIC_NO_PIC = NO; 200 | GCC_NO_COMMON_BLOCKS = YES; 201 | GCC_OPTIMIZATION_LEVEL = 0; 202 | GCC_PREPROCESSOR_DEFINITIONS = ( 203 | "DEBUG=1", 204 | "$(inherited)", 205 | ); 206 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 207 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 208 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 209 | GCC_WARN_UNDECLARED_SELECTOR = YES; 210 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 211 | GCC_WARN_UNUSED_FUNCTION = YES; 212 | GCC_WARN_UNUSED_VARIABLE = YES; 213 | MACOSX_DEPLOYMENT_TARGET = 10.9; 214 | MTL_ENABLE_DEBUG_INFO = YES; 215 | ONLY_ACTIVE_ARCH = YES; 216 | SDKROOT = macosx; 217 | VERSIONING_SYSTEM = "apple-generic"; 218 | VERSION_INFO_PREFIX = ""; 219 | }; 220 | name = Debug; 221 | }; 222 | E691CDBE1A65564B005FF12F /* Release */ = { 223 | isa = XCBuildConfiguration; 224 | buildSettings = { 225 | ALWAYS_SEARCH_USER_PATHS = NO; 226 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 227 | CLANG_CXX_LIBRARY = "libc++"; 228 | CLANG_ENABLE_MODULES = YES; 229 | CLANG_ENABLE_OBJC_ARC = YES; 230 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 231 | CLANG_WARN_BOOL_CONVERSION = YES; 232 | CLANG_WARN_COMMA = YES; 233 | CLANG_WARN_CONSTANT_CONVERSION = YES; 234 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 235 | CLANG_WARN_EMPTY_BODY = YES; 236 | CLANG_WARN_ENUM_CONVERSION = YES; 237 | CLANG_WARN_INFINITE_RECURSION = YES; 238 | CLANG_WARN_INT_CONVERSION = YES; 239 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 240 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 241 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 242 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 243 | CLANG_WARN_STRICT_PROTOTYPES = YES; 244 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 245 | CLANG_WARN_UNREACHABLE_CODE = YES; 246 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 247 | COPY_PHASE_STRIP = YES; 248 | CURRENT_PROJECT_VERSION = 1; 249 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 250 | ENABLE_NS_ASSERTIONS = NO; 251 | ENABLE_STRICT_OBJC_MSGSEND = YES; 252 | GCC_C_LANGUAGE_STANDARD = gnu99; 253 | GCC_NO_COMMON_BLOCKS = YES; 254 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 255 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 256 | GCC_WARN_UNDECLARED_SELECTOR = YES; 257 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 258 | GCC_WARN_UNUSED_FUNCTION = YES; 259 | GCC_WARN_UNUSED_VARIABLE = YES; 260 | MACOSX_DEPLOYMENT_TARGET = 10.9; 261 | MTL_ENABLE_DEBUG_INFO = NO; 262 | SDKROOT = macosx; 263 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 264 | VERSIONING_SYSTEM = "apple-generic"; 265 | VERSION_INFO_PREFIX = ""; 266 | }; 267 | name = Release; 268 | }; 269 | E691CDC01A65564B005FF12F /* Debug */ = { 270 | isa = XCBuildConfiguration; 271 | buildSettings = { 272 | COMBINE_HIDPI_IMAGES = YES; 273 | DEFINES_MODULE = YES; 274 | DYLIB_COMPATIBILITY_VERSION = 1; 275 | DYLIB_CURRENT_VERSION = 1; 276 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 277 | FRAMEWORK_VERSION = A; 278 | INFOPLIST_FILE = XcodeScripting/Info.plist; 279 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 280 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 281 | PRODUCT_BUNDLE_IDENTIFIER = "com.majestysoftware.$(PRODUCT_NAME:rfc1034identifier)"; 282 | PRODUCT_NAME = "$(TARGET_NAME)"; 283 | SKIP_INSTALL = YES; 284 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 285 | SWIFT_VERSION = 4.0; 286 | }; 287 | name = Debug; 288 | }; 289 | E691CDC11A65564B005FF12F /* Release */ = { 290 | isa = XCBuildConfiguration; 291 | buildSettings = { 292 | COMBINE_HIDPI_IMAGES = YES; 293 | DEFINES_MODULE = YES; 294 | DYLIB_COMPATIBILITY_VERSION = 1; 295 | DYLIB_CURRENT_VERSION = 1; 296 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 297 | FRAMEWORK_VERSION = A; 298 | INFOPLIST_FILE = XcodeScripting/Info.plist; 299 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 300 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 301 | PRODUCT_BUNDLE_IDENTIFIER = "com.majestysoftware.$(PRODUCT_NAME:rfc1034identifier)"; 302 | PRODUCT_NAME = "$(TARGET_NAME)"; 303 | SKIP_INSTALL = YES; 304 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 305 | SWIFT_VERSION = 4.0; 306 | }; 307 | name = Release; 308 | }; 309 | /* End XCBuildConfiguration section */ 310 | 311 | /* Begin XCConfigurationList section */ 312 | E691CDA31A65564B005FF12F /* Build configuration list for PBXProject "XcodeScripting" */ = { 313 | isa = XCConfigurationList; 314 | buildConfigurations = ( 315 | E691CDBD1A65564B005FF12F /* Debug */, 316 | E691CDBE1A65564B005FF12F /* Release */, 317 | ); 318 | defaultConfigurationIsVisible = 0; 319 | defaultConfigurationName = Release; 320 | }; 321 | E691CDBF1A65564B005FF12F /* Build configuration list for PBXNativeTarget "XcodeScripting" */ = { 322 | isa = XCConfigurationList; 323 | buildConfigurations = ( 324 | E691CDC01A65564B005FF12F /* Debug */, 325 | E691CDC11A65564B005FF12F /* Release */, 326 | ); 327 | defaultConfigurationIsVisible = 0; 328 | defaultConfigurationName = Release; 329 | }; 330 | /* End XCConfigurationList section */ 331 | }; 332 | rootObject = E691CDA01A65564B005FF12F /* Project object */; 333 | } 334 | -------------------------------------------------------------------------------- /Frameworks/XcodeScripting/XcodeScripting.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Frameworks/XcodeScripting/XcodeScripting/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2015 Majesty Software. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Frameworks/XcodeScripting/XcodeScripting/XcodeScripting.h: -------------------------------------------------------------------------------- 1 | // 2 | // XcodeScripting.h 3 | // XcodeScripting 4 | // 5 | // Copyright (c) 2015 Majesty Software. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import 27 | 28 | //! Project version number for XcodeScripting. 29 | FOUNDATION_EXPORT double XcodeScriptingVersionNumber; 30 | 31 | //! Project version string for XcodeScripting. 32 | FOUNDATION_EXPORT const unsigned char XcodeScriptingVersionString[]; 33 | 34 | // In this header, you should import all the public headers of your framework using statements like #import 35 | -------------------------------------------------------------------------------- /Frameworks/XcodeScripting/XcodeScripting/XcodeScripting.swift: -------------------------------------------------------------------------------- 1 | public enum XcodeScripting: String { 2 | case xcode3FileReference = "Xcode 3 file reference" 3 | case xcode3Group = "Xcode 3 group" 4 | case application = "application" 5 | case attachment = "attachment" 6 | case attributeRun = "attribute run" 7 | case attribute = "attribute" 8 | case baseBuildSetting = "base build setting" 9 | case blueprintDocument = "blueprint document" 10 | case bookmark = "bookmark" 11 | case breakpoint = "breakpoint" 12 | case buildConfigurationType = "build configuration type" 13 | case buildConfiguration = "build configuration" 14 | case buildFile = "build file" 15 | case buildJavaResourcesPhase = "build java resources phase" 16 | case buildMessage = "build message" 17 | case buildPhase = "build phase" 18 | case buildResourceManagerResourcesPhase = "build resource manager resources phase" 19 | case buildSetting = "build setting" 20 | case buildStyle = "build style" 21 | case character = "character" 22 | case classModelDocument = "class model document" 23 | case codeClass = "code class" 24 | case compileApplescriptsPhase = "compile applescripts phase" 25 | case compileSourcesPhase = "compile sources phase" 26 | case containerItem = "container item" 27 | case container = "container" 28 | case copyBundleResourcesPhase = "copy bundle resources phase" 29 | case copyFilesPhase = "copy files phase" 30 | case copyHeadersPhase = "copy headers phase" 31 | case dataModelDocument = "data model document" 32 | case document = "document" 33 | case entity = "entity" 34 | case environmentVariable = "environment variable" 35 | case executable = "executable" 36 | case fetchRequest = "fetch request" 37 | case fetchedProperty = "fetched property" 38 | case fileBreakpoint = "file breakpoint" 39 | case fileDocument = "file document" 40 | case fileReference = "file reference" 41 | case flattenedBuildSetting = "flattened build setting" 42 | case group = "group" 43 | case inputPath = "input path" 44 | case insertionPoint = "insertion point" 45 | case itemReference = "item reference" 46 | case launchArgument = "launch argument" 47 | case linkBinaryWithLibrariesPhase = "link binary with libraries phase" 48 | case modelDocument = "model document" 49 | case operation = "operation" 50 | case outputPath = "output path" 51 | case paragraph = "paragraph" 52 | case printSettings = "print settings" 53 | case projectDocument = "project document" 54 | case projectItem = "project item" 55 | case projectTemplate = "project template" 56 | case project = "project" 57 | case relationship = "relationship" 58 | case richText = "rich text" 59 | case runScriptPhase = "run script phase" 60 | case scheme = "scheme" 61 | case scmRevision = "scm revision" 62 | case sourceDirectory = "source directory" 63 | case sourceDocument = "source document" 64 | case symbolicBreakpoint = "symbolic breakpoint" 65 | case targetDependency = "target dependency" 66 | case targetTemplate = "target template" 67 | case target = "target" 68 | case textBookmark = "text bookmark" 69 | case textDocument = "text document" 70 | case variable = "variable" 71 | case word = "word" 72 | case workspaceDocument = "workspace document" 73 | } 74 | -------------------------------------------------------------------------------- /Frameworks/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | PROJECTS=`/bin/ls -d *Scripting *Utilities` 4 | 5 | for project in $PROJECTS 6 | do 7 | ( 8 | echo $project 9 | cd "$project" 10 | rm -rf build 11 | xcodebuild 12 | ) 13 | done 14 | 15 | rm -rf Build 16 | mkdir -p Build 17 | 18 | for project in $PROJECTS 19 | do 20 | mv "$project/build/Release/$project.framework" Build 21 | done 22 | -------------------------------------------------------------------------------- /Frameworks/generate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | PROJECTS=`/bin/ls -d *Scripting` 4 | 5 | for project in $PROJECTS 6 | do 7 | ( 8 | echo $project 9 | cd "$project/$project" 10 | header_name=`echo $project | sed -e 's/Scripting//'` 11 | ../../../sbhc.py $header_name.h 12 | ../../../sbsc.py $header_name.sdef 13 | ) 14 | done 15 | -------------------------------------------------------------------------------- /Frameworks/iTunesScripting/iTunesScripting.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Frameworks/iTunesScripting/iTunesScripting/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2016 Majesty Software. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Frameworks/iTunesScripting/iTunesScripting/iTunesScripting.h: -------------------------------------------------------------------------------- 1 | // 2 | // iTunesScripting.h 3 | // iTunesScripting 4 | // 5 | // Created by Tony Ingraldi on 6/28/16. 6 | // Copyright © 2016 Majesty Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for iTunesScripting. 12 | FOUNDATION_EXPORT double iTunesScriptingVersionNumber; 13 | 14 | //! Project version string for iTunesScripting. 15 | FOUNDATION_EXPORT const unsigned char iTunesScriptingVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Frameworks/iTunesScripting/iTunesScripting/iTunesScripting.swift: -------------------------------------------------------------------------------- 1 | public enum iTunesScripting: String { 2 | case airplayDevice = "AirPlay device" 3 | case eqPreset = "EQ preset" 4 | case eqWindow = "EQ window" 5 | case urlTrack = "URL track" 6 | case application = "application" 7 | case artwork = "artwork" 8 | case audioCdPlaylist = "audio CD playlist" 9 | case audioCdTrack = "audio CD track" 10 | case browserWindow = "browser window" 11 | case encoder = "encoder" 12 | case fileTrack = "file track" 13 | case folderPlaylist = "folder playlist" 14 | case item = "item" 15 | case libraryPlaylist = "library playlist" 16 | case miniplayerWindow = "miniplayer window" 17 | case playlistWindow = "playlist window" 18 | case playlist = "playlist" 19 | case printSettings = "print settings" 20 | case radioTunerPlaylist = "radio tuner playlist" 21 | case sharedTrack = "shared track" 22 | case source = "source" 23 | case subscriptionPlaylist = "subscription playlist" 24 | case track = "track" 25 | case userPlaylist = "user playlist" 26 | case videoWindow = "video window" 27 | case visual = "visual" 28 | case window = "window" 29 | } 30 | -------------------------------------------------------------------------------- /Frameworks/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | INSTALL_DIR=/Library/Frameworks 4 | PROJECTS=`/bin/ls -d *Scripting *Utilities` 5 | 6 | for project in $PROJECTS 7 | do 8 | sudo rm -rf "$INSTALL_DIR/$project.framework" 9 | sudo mv Build/"$project.framework" "$INSTALL_DIR" 10 | done 11 | -------------------------------------------------------------------------------- /Frameworks/sbhc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | PROJECTS=`/bin/ls -d *Scripting` 4 | SBHC=`pwd`/../sbhc.py 5 | 6 | # Strip off "Scripting" from name of project 7 | projectRoot() { 8 | chars=`echo $1 | wc -c` 9 | chars=`expr $chars - 10` 10 | echo $1 | cut -c1-$chars 11 | } 12 | 13 | for project in $PROJECTS 14 | do 15 | ( 16 | echo $project 17 | cd "$project/$project" 18 | root=`projectRoot $project` 19 | header="$root.h" 20 | $SBHC "$header" 21 | ) 22 | done 23 | 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SwiftScripting 2 | Utilities and samples to aid in using Swift with the Scripting Bridge 3 | 4 | ## Generating Swift API for a Target Application 5 | 6 | The scripting approach leveraged here is a Swift layer on top of the [Scripting Bridge](https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ScriptingBridgeConcepts/Introduction/Introduction.html). 7 | Xcode ships with a pair of utilities, `sdef` and `sdp`, to aid Objective-C programmers in using the Scripting Bridge. 8 | 9 | The `sdef` tool is used to extract the scripting definition from an application. It emits the scripting 10 | definition to standard output in XML format. The `sdp` tool can be used to convert the XML emitted by 11 | `sdef` to an Objective-C header file. This header file defines the scripting interface for a target application 12 | exposed to Objective-C by the Scripting Bridge. 13 | 14 | When scripting applications using Swift, it is possible to leverage the same Objective-C headers emitted by `sdp`. 15 | However, due to the dynamically generated classes involved in realizing the Scripting Bridge interface, this approach 16 | can be cumbersome and forces the use of `AnyObject` types even in areas when more specific types are known to 17 | exist. 18 | 19 | The approach here is to generate a set of Swift protocols based on the Objective-C header emitted by `sdp`. In most cases, 20 | the generated file can be used without modification. There are some corner cases where manual editing is required to 21 | correct issues or workaround bugs in the Swift compiler. 22 | 23 | The basic recipe for generating the Swift protocols and enums for a fictitious application called App.app is as follows 24 | 25 | 1. `sdef /Applications/App.app > App.sdef` 26 | 2. `sdp -fh --basename App App.sdef` 27 | 3. `sbhc.py App.h` 28 | 4. `sbsc.py App.sdef` 29 | 30 | Step 1 will create the `App.sdef` file in the current directory. Step 2 will create a file `App.h`, also in the current 31 | directory. Step 3 will create `App.swift` in the current directory. This is the primary file describing the scripting interface. The final step will create the file `AppScripting.swift` which contains an enum with values appropriate for class creation. 32 | 33 | Note that the sbhc.py script leverages the [Python bindings](https://pypi.python.org/pypi/clang/3.5) for libclang. 34 | You must install these bindings before running the script. (`pip install 'clang<=16'` for macOS 14 Sonoma). You'll also need to install the Xcode command line tools (`xcode-select --install`.) 35 | 36 | See [https://majestysoftware.wordpress.com/2015/03/31/swift-scripting-part-1/](https://majestysoftware.wordpress.com/2015/03/31/swift-scripting-part-1/) for part one of a four-part series that gives a bit of explanation related to SwiftScripting. 37 | -------------------------------------------------------------------------------- /Samples/Acorn/Scale and Export as PNG.swift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/xcrun swift -F /Library/Frameworks 2 | 3 | // Copyright (c) 2015 Majesty Software. 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | // Acorn sample script. 24 | // Exports the frontmost document open in Acorn and exports it as PNG 25 | // in three different sizes. 26 | // 27 | // @3x - same size as source image 28 | // @2x - 2/3 the size of the source image 29 | // 1x - 1/3 the size of the source image 30 | // 31 | // Images are exported to the Images folder on the user's Desktop. The Images 32 | // folder is created if it doesn't already exist. 33 | // 34 | 35 | import Foundation 36 | import ScriptingUtilities 37 | import AcornScripting 38 | 39 | let acorn = application(name: "Acorn") as! AcornApplication 40 | 41 | let imageFolderURL = URL(fileURLWithPath:("~/Desktop/Images" as NSString).expandingTildeInPath) 42 | 43 | do { 44 | try FileManager.default.createDirectory(at: imageFolderURL, 45 | withIntermediateDirectories: true, 46 | attributes: nil) 47 | } catch let _ as NSError { 48 | } 49 | 50 | Process.launchedProcess(launchPath: "/usr/bin/open", arguments: [imageFolderURL.path]) 51 | 52 | let document = acorn.documents!().object(atLocation: 0) as! AcornDocument 53 | let name = (document.name! as NSString).deletingPathExtension 54 | 55 | for (scale, suffix) in [1.0 : "@3x", 2.0 / 3.0 : "@2x", 1.0 / 3.0 : ""] { 56 | let fileName = "\(name)\(suffix).png" 57 | let fileURL: URL! = imageFolderURL.appendingPathComponent(fileName) 58 | let scaledWidth = Int(scale * document.width!) 59 | let scaledHeight = Int(scale * document.height!) 60 | document.webExportIn!(fileURL, 61 | as: .png, 62 | quality: 100, 63 | width: scaledWidth, 64 | height: scaledHeight) 65 | } 66 | 67 | notifyUserWithMessage("Export complete.", title: "Acorn") 68 | -------------------------------------------------------------------------------- /Samples/Acorn/Taunt.swift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/xcrun swift -F /Library/Frameworks 2 | 3 | // Copyright (c) 2015 Majesty Software. 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | // Acorn sample script. 24 | // It tells Acorn to taunt you. 25 | // 26 | 27 | import ScriptingUtilities 28 | import AcornScripting 29 | 30 | let _ = (application(name: "Acorn") as! AcornApplication).taunt!() 31 | -------------------------------------------------------------------------------- /Samples/BBEdit/Run Script.swift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/xcrun swift -F /Library/Frameworks 2 | 3 | // Copyright (c) 2017 Majesty Software. 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | // BBEdit sample script. 24 | // It tells BBEdit to save and run the frontmost document in Terminal. 25 | // Place this script in "~/Library/Application Support/BBEdit/Scripts" and it 26 | // will appear as a menu option in BBEdit's Script Menu. 27 | // 28 | 29 | import Foundation 30 | import ScriptingUtilities 31 | import BBEditScripting 32 | import TerminalScripting 33 | 34 | let bbEdit = application(name: "BBEdit") as! BBEditApplication 35 | let terminal = application(name: "Terminal") as! TerminalApplication 36 | 37 | let window = bbEdit.windows!().object(atLocation: 1) as! BBEditWindow 38 | let document = window.document! as BBEditDocument 39 | 40 | document.saveTo!(nil, savingAsStationery: false, addToRecentList: true) 41 | 42 | if document.onDisk! { 43 | let fileURL: NSURL! = NSURL(string: document.file!.description) 44 | let path = fileURL.path! as NSString 45 | let name = path.lastPathComponent 46 | let directory = path.deletingLastPathComponent 47 | 48 | let script = "cd '\(directory)'; chmod u+x '\(name)';clear; ./'\(name)'" 49 | 50 | terminal.activate() 51 | let terminalWindow = terminal.windows!().object(atLocation: 1) as! TerminalWindow 52 | let tab = terminalWindow.selectedTab! as TerminalTab 53 | 54 | if !terminalWindow.frontmost! || tab.busy! { 55 | let _ = terminal.doScript!(script, in:nil) 56 | } else { 57 | let _ = terminal.doScript!(script, in:terminalWindow) 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Samples/Image Events/Scale Image by Half.swift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/xcrun swift -F /Library/Frameworks 2 | 3 | // Copyright (c) 2015 Majesty Software. 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | // Image Events sample script. 24 | // Operates on selected images in the Finder 25 | // Outputs half-scale images in same folder as originals 26 | // 27 | 28 | import Foundation 29 | import FinderScripting 30 | import ImageEventsScripting 31 | import ScriptingUtilities 32 | 33 | let imageExtensions = ["png", "jpg", "jpeg", "tif", "tiff", "gif"] 34 | 35 | let finder = application(name: "Finder") as! FinderApplication 36 | let imageEvents = application(name: "Image Events") as! ImageEventsApplication 37 | 38 | for item in (finder.selection!.get() as! NSArray) { 39 | if let file = item as? FinderFile { 40 | let fileExtension = file.nameExtension!.lowercased() 41 | if imageExtensions.contains(fileExtension) { 42 | let fileURL: URL! = URL(string: file.URL!) 43 | let outputLocation: URL! = fileURL.deletingLastPathComponent() 44 | let outputFilename = "\((file.name! as NSString).deletingPathExtension) (half-scale).\(fileExtension)" 45 | let outputURL: URL! = outputLocation.appendingPathComponent(outputFilename) 46 | 47 | let image = imageEvents.open!(fileURL!) as! ImageEventsImage 48 | image.scaleByFactor!(0.5, toSize: 0) 49 | 50 | image.closeSaving!(.yes, savingIn: outputURL.path) 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /Samples/Pages/Mail as PDF.swift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/xcrun swift -F /Library/Frameworks 2 | 3 | // Copyright (c) 2015 Majesty Software. 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | // Pages sample script. 24 | // 25 | // Exports the frontmost Pages document as PDF and attaches it to a new 26 | // Mail message 27 | // 28 | 29 | import Foundation 30 | import ScriptingUtilities 31 | import MailScripting 32 | import PagesScripting 33 | 34 | let pages = application(name: "Pages") as! PagesApplication 35 | let mail = application(name: "Mail") as! MailApplication 36 | 37 | let document = pages.documents!().object(atLocation: 1) as! PagesDocument 38 | let tempDirectory = NSURL(fileURLWithPath: "/tmp") 39 | let pdfName = "\((document.name! as NSString).deletingPathExtension).pdf" 40 | let pdfURL: URL! = tempDirectory.appendingPathComponent(pdfName) 41 | 42 | document.exportTo!(pdfURL, as: .pdf, withProperties: nil) 43 | 44 | let futureMessage = objectWithApplication(mail, scriptingClass: MailScripting.outgoingMessage) 45 | mail.outgoingMessages!().add(futureMessage!) 46 | let message = futureMessage! as MailOutgoingMessage 47 | 48 | let futureAttachment = objectWithApplication(mail, scriptingClass: MailScripting.attachment, properties: ["fileName": pdfURL]) 49 | message.content!.attachments!().add(futureAttachment!) 50 | mail.activate() 51 | -------------------------------------------------------------------------------- /Samples/Safari/OpenAppleDotCom.swift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/xcrun swift -F /Library/Frameworks 2 | 3 | // Copyright (c) 2017 Majesty Software. 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | // Safari sample script. 24 | // It tells Safari to open https://apple.com. 25 | // 26 | 27 | import ScriptingUtilities 28 | import SafariScripting 29 | 30 | let safari = application(name: "Safari") as! SafariApplication 31 | 32 | let document = objectWithApplication(safari, scriptingClass: SafariScripting.document) as SafariDocument 33 | 34 | safari.documents!().add(document) 35 | 36 | document.setURL!("https://apple.com") 37 | 38 | safari.activate() 39 | -------------------------------------------------------------------------------- /Samples/Xcode/View in SourceTree.swift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/xcrun swift -F /Library/Frameworks 2 | 3 | // Copyright (c) 2015 Majesty Software. 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | // Xcode sample script. 24 | // 25 | // Views the repository associated with the active project in SourceTree. 26 | // Assumes that SourceTree (http://www.sourcetreeapp.com) and its associated 27 | // stree command-line tool has been installed. 28 | 29 | import Foundation 30 | import ScriptingUtilities 31 | import XcodeScripting 32 | 33 | let xcode = application(name: "Xcode") as! XcodeApplication 34 | 35 | let workspace = xcode.activeWorkspaceDocument! 36 | let pathComponents = workspace.file!.pathComponents.filter { 37 | !$0.hasSuffix(".xcodeproj") && !$0.hasSuffix(".xcworkspace") 38 | } 39 | 40 | let process = Process() 41 | process.launchPath = "/usr/local/bin/stree" 42 | process.environment = ["PWD" : NSString.path(withComponents: pathComponents)] 43 | process.launch() 44 | -------------------------------------------------------------------------------- /Samples/Xcode/Visit In Finder.swift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/xcrun swift -F /Library/Frameworks 2 | 3 | // Copyright (c) 2015 Majesty Software. 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | // Xcode sample script. 24 | // 25 | // Visits the location of the frontmost project/workspace in the Finder 26 | 27 | import Foundation 28 | import ScriptingUtilities 29 | import XcodeScripting 30 | 31 | let xcode = application(name: "Xcode") as! XcodeApplication 32 | 33 | let workspace = xcode.activeWorkspaceDocument! 34 | let pathComponents = workspace.file!.pathComponents.filter { 35 | !$0.hasSuffix(".xcodeproj") && !$0.hasSuffix(".xcworkspace") 36 | } 37 | let path = NSString.path(withComponents: pathComponents) 38 | Process.launchedProcess(launchPath: "/usr/bin/open", arguments: [path]) 39 | -------------------------------------------------------------------------------- /Samples/Xcode/Visit In Terminal.swift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/xcrun swift -F /Library/Frameworks 2 | 3 | // Copyright (c) 2015 Majesty Software. 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | // Xcode sample script. 24 | // 25 | // Visits the location of the frontmost project/workspace in the Terminal 26 | 27 | import Foundation 28 | import ScriptingUtilities 29 | import XcodeScripting 30 | import TerminalScripting 31 | 32 | let xcode = application(name: "Xcode") as! XcodeApplication 33 | let terminal = application(name: "Terminal") as! TerminalApplication 34 | 35 | let workspace = xcode.activeWorkspaceDocument! 36 | let pathComponents = workspace.file!.pathComponents.filter { 37 | !$0.hasSuffix(".xcodeproj") && !$0.hasSuffix(".xcworkspace") 38 | } 39 | let path = NSString.path(withComponents: pathComponents) 40 | let script = "cd '\(path)'; clear;" 41 | 42 | terminal.activate() 43 | let terminalWindow = terminal.windows!().object(atLocation: 1) as! TerminalWindow 44 | let tab = terminalWindow.selectedTab! as TerminalTab 45 | 46 | if !terminalWindow.frontmost! || tab.busy! { 47 | let _ = terminal.doScript!(script, in:nil) 48 | } else { 49 | let _ = terminal.doScript!(script, in:terminalWindow) 50 | } 51 | 52 | -------------------------------------------------------------------------------- /Samples/Xcode/Visit Web Repo.swift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/xcrun swift -F /Library/Frameworks 2 | 3 | // Copyright (c) 2015 Majesty Software. 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | // Xcode sample script. 24 | // 25 | // Visits the web site associated with the git repository for the active project. 26 | // Assumes that the project is part of a git repository and that the repository has a 27 | // remote origin url of the form 28 | // 29 | // username@host.com:path/repo_name.git 30 | // 31 | // Remote services known to work include GitHub, Bitbucket, and GitLab. 32 | // Git hosting service is assumed to use HTTPS. 33 | // 34 | 35 | import Foundation 36 | import ScriptingUtilities 37 | import XcodeScripting 38 | 39 | let xcode = application(name: "Xcode") as! XcodeApplication 40 | 41 | let workspace = xcode.activeWorkspaceDocument! 42 | let pathComponents = workspace.file!.pathComponents.filter { 43 | !$0.hasSuffix(".xcodeproj") && !$0.hasSuffix(".xcworkspace") 44 | } 45 | 46 | if let URLString = commandOutput("/usr/bin/git", 47 | withArguments: ["config", "--get", "remote.origin.url"], 48 | currentDirectoryPath: NSString.path(withComponents: pathComponents)), 49 | URLString.count > 0 { 50 | let parts = (URLString as NSString).components(separatedBy: "@") 51 | if parts.count == 2 { 52 | let partOne = parts[1] 53 | var location = (partOne as NSString).deletingPathExtension 54 | location = (location as NSString).replacingOccurrences(of: ":", with:"/") 55 | Process.launchedProcess(launchPath: "/usr/bin/open", arguments: ["https://\(location)"]) 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Samples/iTunes/LibrarySize.swift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/xcrun swift -F /Library/Frameworks 2 | 3 | // Copyright (c) 2016 Majesty Software. 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | // iTunes sample script. 24 | // Prints out the name of the currently playing track. 25 | // 26 | 27 | import ScriptingUtilities 28 | import iTunesScripting 29 | 30 | let iTunes = application(name: "iTunes") as! iTunesApplication 31 | let librarySource = iTunes.sources!().filter({ 32 | let tunesSource = $0 as! iTunesSource 33 | return tunesSource.name! == "Library" 34 | }).first! as! iTunesSource 35 | 36 | print(librarySource.name!) 37 | -------------------------------------------------------------------------------- /Samples/iTunes/WhatsPlaying.swift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/xcrun swift -F /Library/Frameworks 2 | 3 | // Copyright (c) 2016 Majesty Software. 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 13 | // all 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 21 | // THE SOFTWARE. 22 | 23 | // iTunes sample script. 24 | // Prints out the name of the currently playing track. 25 | // 26 | 27 | import ScriptingUtilities 28 | import iTunesScripting 29 | 30 | let iTunes = application(name: "iTunes") as! iTunesApplication 31 | 32 | var playing = iTunes.currentTrack!.name! 33 | 34 | if playing.isEmpty { 35 | playing = "Nothing is playing" 36 | } 37 | 38 | print(playing) -------------------------------------------------------------------------------- /sbhc_tests.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import unittest 4 | import sbhc 5 | 6 | 7 | class MockType: 8 | def __init__(self, spelling, kind=None): 9 | self.spelling = spelling 10 | self.kind = kind 11 | 12 | 13 | class SBHCTestCase(unittest.TestCase): 14 | def test_safe_name(self): 15 | self.assertEqual('class', sbhc.safe_name('class')) 16 | self.assertEqual('`var`', sbhc.safe_name('var')) 17 | self.assertEqual('arg', sbhc.safe_name('arg')) 18 | 19 | def test_strip_prefix(self): 20 | self.assertEqual('Suffix', sbhc.strip_prefix('ABC', 'ABCSuffix')) 21 | self.assertEqual('Suffix', sbhc.strip_prefix('ABC', 'Suffix')) 22 | self.assertEqual('Suffix', sbhc.strip_prefix('', 'Suffix')) 23 | 24 | def test_type_for_type(self): 25 | self.assertEqual('Bool', sbhc.type_for_type(MockType('BOOL'))) 26 | self.assertEqual('[AnyObject]', sbhc.type_for_type(MockType('NSArray *', sbhc.object_kinds[0]))) 27 | self.assertEqual('[URL]', sbhc.type_for_type(MockType('NSArray *', sbhc.object_kinds[0]))) 28 | self.assertEqual('[String : NSNumber]', sbhc.type_for_type(MockType('NSDictionary *', sbhc.object_kinds[0]))) 29 | self.assertEqual('Set', sbhc.type_for_type(MockType('NSSet *', sbhc.object_kinds[0]))) 30 | 31 | def test_type_for_spelling(self): 32 | self.assertEqual('NSNumber', sbhc.type_for_spelling('NSNumber *')) 33 | 34 | def test_enum_case(self): 35 | self.assertEqual('jpeg', sbhc.enum_case('Prefix', 'PrefixJPEG')) 36 | self.assertEqual('macOSFormat', sbhc.enum_case('Prefix', 'PrefixMacOSFormat')) 37 | self.assertEqual('ufsFormat', sbhc.enum_case('Prefix', 'PrefixUFSFormat')) 38 | self.assertEqual('iso9660Format', sbhc.enum_case('Prefix', 'PrefixISO9660Format')) 39 | self.assertEqual('none', sbhc.enum_case('Prefix', 'PrefixNone')) 40 | self.assertEqual('quickTakeFormat', sbhc.enum_case('Prefix', 'PrefixQuickTakeFormat')) 41 | 42 | 43 | if __name__ == '__main__': 44 | unittest.main() 45 | -------------------------------------------------------------------------------- /sbsc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # Copyright (c) 2015 Majesty Software. 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 13 | # all 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 21 | # THE SOFTWARE. 22 | # 23 | # Creates a Swift source file containing an enum encompassing the scripting 24 | # class names for the SDEF file specified on the command line. 25 | # 26 | # Sample usage: 27 | # 28 | # sbsc.py App.sdef 29 | # 30 | 31 | import os 32 | import string 33 | import sys 34 | from sbhc import enum_case 35 | 36 | 37 | def transform(name_string): 38 | name_string = name_string.replace('"', '') 39 | name_string = name_string.replace('-', ' ') 40 | name_string = string.capwords(name_string.replace(' ', '')) 41 | return enum_case('', name_string) 42 | 43 | 44 | def name_from_path(path): 45 | last_part = path.split("/")[-1] 46 | return last_part.split('.')[0] 47 | 48 | 49 | def extract_cases(xpath, keyword): 50 | command_template = "xmllint --xpath '" + xpath + "' {} 2>/dev/null" 51 | pipe = os.popen(command_template.format(sys.argv[1])) 52 | raw_names = pipe.read() 53 | pipe.close() 54 | separator = keyword + "=" 55 | names = set() 56 | for raw_name in raw_names.strip().split(separator): 57 | if len(raw_name.strip()): 58 | names.add(raw_name.strip()) 59 | return names 60 | 61 | enum_name = '{}Scripting'.format(name_from_path(sys.argv[1])) 62 | out_file = open('{}.swift'.format(enum_name), 'w') 63 | 64 | out_file.write('public enum {}: String {{\n'.format(enum_name)) 65 | 66 | names = extract_cases("//suite/class/@name", "name") 67 | names = names.union(extract_cases("//suite/class-extension/@extends", "extends")) 68 | names = list(names) 69 | names.sort() 70 | 71 | for name in names: 72 | out_file.write(' case {} = {}\n'.format(transform(name), name)) 73 | 74 | out_file.write('}\n') 75 | out_file.close() 76 | --------------------------------------------------------------------------------