├── .DS_Store ├── .gitignore ├── LICENSE ├── README.md └── Scripts ├── .DS_Store ├── Artwork ├── artwork │ ├── A Reality Tour (Bonus Track Version) [Live].jpg │ ├── Aladdin Sane (2013 Remastered Version).jpg │ ├── Best of Bowie.jpg │ ├── Black Tie White Noise.jpg │ ├── Blackstar.jpg │ ├── Changesbowie.jpg │ ├── Dancing In the Street - EP.jpg │ ├── David Bowie (2015 Remastered Version).jpg │ ├── David Bowie (Deluxe Edition).jpg │ ├── David Bowie Narrates Prokofiev's Peter and the Wolf.jpg │ ├── David Bowie.jpg │ ├── David Live.jpg │ ├── Diamond Dogs (30th Anniversary Edition).jpg │ ├── Diamond Dogs.jpg │ ├── Earthling (Expanded Edition).jpg │ ├── Five Years 1969-1973.jpg │ ├── Heathen.jpg │ ├── Heroes.jpg │ ├── Hunky Dory (Remastered).jpg │ ├── Labyrinth (From the Original Soundtrack of the Jim Henson Film).jpg │ ├── Legacy.jpg │ ├── Let's Dance.jpg │ ├── Live Santa Monica '72.jpg │ ├── Lodger.jpg │ ├── Low.jpg │ ├── Nothing Has Changed (Deluxe Edition).jpg │ ├── Outside.jpg │ ├── PinUps (2015 Remastered Version).jpg │ ├── Prokofiev: Peter and the Wolf.jpg │ ├── Reality (Bonus Track Version).jpg │ ├── Scary Monsters (And Super Creeps).jpg │ ├── Sound + Vision.jpg │ ├── Space Oddity.jpg │ ├── Stage (Live).jpg │ ├── Station to Station (Deluxe Edition).jpg │ ├── Station to Station.jpg │ ├── The Deram Anthology 1966-1968.jpg │ ├── The Man Who Sold the World (2015 Remastered Version).jpg │ ├── The Next Day Extra EP.jpg │ ├── The Next Day.jpg │ ├── The Platinum Collection.jpg │ ├── The Rise and Fall of Ziggy Stardust and the Spiders From Mars (2012 Remastered Version).jpg │ ├── VH1 Storytellers: David Bowie (Live).jpg │ ├── Who Can I Be Now? (1974 - 1976).jpg │ ├── Young Americans.jpg │ ├── Ziggy Stardust and the Spiders from Mars (The Motion Picture Soundtrack).jpg │ └── iSelect.jpg ├── collage.jpg ├── script └── script.swift ├── BuildScript └── build.swift ├── Colors ├── Colors.swift ├── Frameworks │ ├── PathKit.framework │ │ ├── Headers │ │ ├── Modules │ │ ├── PathKit │ │ ├── Resources │ │ └── Versions │ │ │ ├── A │ │ │ ├── Headers │ │ │ │ ├── PathKit-Swift.h │ │ │ │ └── PathKit-umbrella.h │ │ │ ├── Modules │ │ │ │ ├── PathKit.swiftmodule │ │ │ │ │ ├── x86_64.swiftdoc │ │ │ │ │ └── x86_64.swiftmodule │ │ │ │ └── module.modulemap │ │ │ ├── PathKit │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ └── _CodeSignature │ │ │ │ └── CodeResources │ │ │ └── Current │ └── Stencil.framework │ │ ├── Headers │ │ ├── Modules │ │ ├── Resources │ │ ├── Stencil │ │ └── Versions │ │ ├── A │ │ ├── Headers │ │ │ ├── Stencil-Swift.h │ │ │ └── Stencil-umbrella.h │ │ ├── Modules │ │ │ ├── Stencil.swiftmodule │ │ │ │ ├── x86_64.swiftdoc │ │ │ │ └── x86_64.swiftmodule │ │ │ └── module.modulemap │ │ ├── Resources │ │ │ └── Info.plist │ │ ├── Stencil │ │ └── _CodeSignature │ │ │ └── CodeResources │ │ └── Current ├── ScriptSwift.playground │ ├── Contents.swift │ └── contents.xcplayground ├── colors.json ├── colorstemplate.stencil └── main.swift ├── EmojiQuiz └── emojiquiz.swift └── Giffer ├── Gif └── GifMaker.framework │ ├── GifMaker │ ├── Headers │ ├── Modules │ ├── Resources │ └── Versions │ ├── A │ ├── GifMaker │ ├── Headers │ │ ├── GifMaker-Swift.h │ │ └── GifMaker.h │ ├── Modules │ │ ├── GifMaker.swiftmodule │ │ │ ├── x86_64.swiftdoc │ │ │ └── x86_64.swiftmodule │ │ └── module.modulemap │ └── Resources │ │ └── Info.plist │ └── Current ├── giffer.swift └── images ├── source-1 (dragged).jpeg ├── source-2 (dragged).jpeg ├── source-3 (dragged).jpeg ├── source-4 (dragged).jpeg ├── source-5 (dragged).jpeg ├── source-6 (dragged).jpeg ├── source-7 (dragged).jpeg └── source-8 (dragged).jpeg /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | # Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/Preview.html 64 | fastlane/screenshots 65 | fastlane/test_output 66 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 The Swift Alps 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Swift Scripting 2 | 3 | ### Getting started 4 | 5 | The first step is to add this to the top of your Swift script: 6 | ``` shell 7 | #!/usr/bin/swift 8 | ``` 9 | 10 | The second step is to make it executable 11 | ``` shell 12 | $ chmod +x script.swift 13 | ``` 14 | ### What IDE to use 15 | 16 | For simple scripts, Xcode Playgrounds are a great IDE. Your code runs the same way it would in the command line, you get autocomplete, live previews and a console output. 17 | 18 | For more complex scripts, it is possible to hack Atom into a Swift scripting IDE with the following package installs: 19 | ``` shell 20 | $ apm install script language-swift 21 | ``` 22 | 23 | ### Adding frameworks 24 | Third party libraries need to be compiled as dynamic frameworks - this can be achieved manually or with Carthage or Cocoapods (via the Rome plugin). 25 | 26 | To include in your script, you need to specify a target and a framework path in your shebang 27 | ```shell 28 | #!/usr/bin/swift -target x86_64-macosx10.12 -F /Library/Frameworks -F Rome 29 | ``` 30 | 31 | ### Launch arguments and user input 32 | You can access launch arguments using: 33 | ```swift 34 | CommandLine.arguments 35 | ``` 36 | 37 | You can ask for user input using: 38 | ```swift 39 | let string = readLine() 40 | ``` 41 | 42 | ### Shell 43 | 44 | You can run shell commands using Process() (formerly NSTask) using this function (make sure to import Foundation). 45 | 46 | ```swift 47 | func shell(_ command: String) { 48 | let arguments = command.components(separatedBy: " ") 49 | let process = Process() 50 | process.launchPath = "/usr/bin/env" 51 | process.arguments = arguments 52 | process.waitUntilExit() 53 | process.launch() 54 | } 55 | ``` 56 | 57 | ### Current file path 58 | There's no NSBundle when writing a Swift script. To get the current path use 59 | ```swift 60 | let currentPath = FileManager.default.currentDirectoryPath 61 | ``` 62 | 63 | ### Returning 64 | You can't return in a Swift script. To end the context, use: 65 | ```swift 66 | exit(1) 67 | ``` 68 | 69 | ### Color 70 | 71 | You can format a line by adding color using the following struct: 72 | ```swift 73 | struct commandLineFormat { 74 | static let black = "\u{001B}[0;30m" 75 | static let red = "\u{001B}[0;31m" 76 | static let green = "\u{001B}[0;32m" 77 | static let yellow = "\u{001B}[0;33m" 78 | static let blue = "\u{001B}[0;34m" 79 | static let magenta = "\u{001B}[0;35m" 80 | static let cyan = "\u{001B}[0;36m" 81 | static let white = "\u{001B}[0;37m" 82 | } 83 | ``` 84 | 85 | ### Advanced Shell 86 | 87 | The function breaks down a command into a string array of arguments by separating on " ". This is somewhat hacky as there are actual spaces you might want to keep. 88 | 89 | Additionally, you may wish to capture the output from the process. 90 | 91 | Here is an advanced example: 92 | 93 | ```swift 94 | let shellSeparator = "␣" 95 | 96 | func shell(_ command: String) -> String { 97 | var arguments = command.components(separatedBy: " ") 98 | arguments = arguments.map{ $0.replacingOccurrences(of: shellSeparator, with: " ")} 99 | let pipe = Pipe() 100 | let process = Process() 101 | process.launchPath = "/usr/bin/env" 102 | process.arguments = arguments 103 | process.standardOutput = pipe 104 | process.waitUntilExit() 105 | process.launch() 106 | let data = pipe.fileHandleForReading.readDataToEndOfFile() 107 | return String(data: data, encoding: String.Encoding.utf8) 108 | } 109 | ``` 110 | -------------------------------------------------------------------------------- /Scripts/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/.DS_Store -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/A Reality Tour (Bonus Track Version) [Live].jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/A Reality Tour (Bonus Track Version) [Live].jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Aladdin Sane (2013 Remastered Version).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Aladdin Sane (2013 Remastered Version).jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Best of Bowie.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Best of Bowie.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Black Tie White Noise.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Black Tie White Noise.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Blackstar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Blackstar.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Changesbowie.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Changesbowie.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Dancing In the Street - EP.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Dancing In the Street - EP.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/David Bowie (2015 Remastered Version).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/David Bowie (2015 Remastered Version).jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/David Bowie (Deluxe Edition).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/David Bowie (Deluxe Edition).jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/David Bowie Narrates Prokofiev's Peter and the Wolf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/David Bowie Narrates Prokofiev's Peter and the Wolf.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/David Bowie.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/David Bowie.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/David Live.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/David Live.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Diamond Dogs (30th Anniversary Edition).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Diamond Dogs (30th Anniversary Edition).jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Diamond Dogs.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Diamond Dogs.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Earthling (Expanded Edition).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Earthling (Expanded Edition).jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Five Years 1969-1973.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Five Years 1969-1973.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Heathen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Heathen.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Heroes.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Heroes.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Hunky Dory (Remastered).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Hunky Dory (Remastered).jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Labyrinth (From the Original Soundtrack of the Jim Henson Film).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Labyrinth (From the Original Soundtrack of the Jim Henson Film).jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Legacy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Legacy.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Let's Dance.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Let's Dance.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Live Santa Monica '72.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Live Santa Monica '72.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Lodger.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Lodger.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Low.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Low.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Nothing Has Changed (Deluxe Edition).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Nothing Has Changed (Deluxe Edition).jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Outside.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Outside.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/PinUps (2015 Remastered Version).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/PinUps (2015 Remastered Version).jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Prokofiev: Peter and the Wolf.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Prokofiev: Peter and the Wolf.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Reality (Bonus Track Version).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Reality (Bonus Track Version).jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Scary Monsters (And Super Creeps).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Scary Monsters (And Super Creeps).jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Sound + Vision.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Sound + Vision.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Space Oddity.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Space Oddity.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Stage (Live).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Stage (Live).jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Station to Station (Deluxe Edition).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Station to Station (Deluxe Edition).jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Station to Station.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Station to Station.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/The Deram Anthology 1966-1968.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/The Deram Anthology 1966-1968.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/The Man Who Sold the World (2015 Remastered Version).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/The Man Who Sold the World (2015 Remastered Version).jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/The Next Day Extra EP.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/The Next Day Extra EP.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/The Next Day.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/The Next Day.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/The Platinum Collection.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/The Platinum Collection.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/The Rise and Fall of Ziggy Stardust and the Spiders From Mars (2012 Remastered Version).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/The Rise and Fall of Ziggy Stardust and the Spiders From Mars (2012 Remastered Version).jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/VH1 Storytellers: David Bowie (Live).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/VH1 Storytellers: David Bowie (Live).jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Who Can I Be Now? (1974 - 1976).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Who Can I Be Now? (1974 - 1976).jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Young Americans.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Young Americans.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/Ziggy Stardust and the Spiders from Mars (The Motion Picture Soundtrack).jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/Ziggy Stardust and the Spiders from Mars (The Motion Picture Soundtrack).jpg -------------------------------------------------------------------------------- /Scripts/Artwork/artwork/iSelect.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/artwork/iSelect.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/collage.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/collage.jpg -------------------------------------------------------------------------------- /Scripts/Artwork/script: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Artwork/script -------------------------------------------------------------------------------- /Scripts/Artwork/script.swift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/swift -target x86_64-macosx10.12 -F /Library/Frameworks -F Rome 2 | 3 | import Cocoa 4 | import Foundation 5 | import CoreGraphics 6 | 7 | var arguments = CommandLine.arguments 8 | arguments.remove(at: 0) 9 | //print(arguments) 10 | 11 | let searchTerm = arguments.joined(separator: "+") 12 | 13 | let urlString = "https://itunes.apple.com/search?term=\(searchTerm)&entity=album&limit=24" 14 | let url = URL(string: urlString) 15 | 16 | //print(urlString) 17 | var request = NSURLRequest(url: url!) 18 | 19 | let task = URLSession.shared.dataTask(with: url!) { data, response, error in 20 | guard error == nil else { 21 | print(error as! String) 22 | return 23 | } 24 | guard let data = data else { 25 | print("Data is empty") 26 | return 27 | } 28 | 29 | if let json = try! JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary { 30 | if let results = json["results"] as? NSArray { 31 | let currentPath = FileManager.default.currentDirectoryPath 32 | 33 | var images = [String]() 34 | for album in results { 35 | if let a = album as? NSDictionary { 36 | if let name = a["collectionName"] as? String { 37 | if let artwork = a["artworkUrl100"] as? String { 38 | print(artwork) 39 | let imageURL = URL(string: artwork) 40 | let imageData = NSData(contentsOf: imageURL!)! 41 | let filePath = currentPath + "/artwork/\(name).jpg" 42 | //print(filePath) 43 | images.append(filePath) 44 | imageData.write(toFile:filePath , atomically: true) 45 | } 46 | } 47 | } 48 | } 49 | let rect = CGRect(x: 0, y: 0, width: 400, height:400) 50 | let rep = NSBitmapImageRep( 51 | bitmapDataPlanes: nil, 52 | pixelsWide: Int(rect.size.width), 53 | pixelsHigh: Int(rect.size.height), 54 | bitsPerSample: 8, 55 | samplesPerPixel: 4, 56 | hasAlpha: true, 57 | isPlanar: false, 58 | colorSpaceName: NSCalibratedRGBColorSpace, 59 | bytesPerRow: 0, 60 | bitsPerPixel: 0) 61 | 62 | let context = NSGraphicsContext(bitmapImageRep: rep!) 63 | 64 | NSGraphicsContext.saveGraphicsState() 65 | NSGraphicsContext.setCurrent(context) 66 | 67 | // 68 | NSColor.yellow.setFill() 69 | NSRectFill(rect) 70 | var index = 0 71 | var indextries = 0 72 | 73 | repeat { 74 | let filePath = images[indextries % images.count] 75 | if let imgA = NSImage(byReferencingFile: filePath) { 76 | if imgA.representations.count != 0 { 77 | if let bitmap = imgA.representations[0] as? NSBitmapImageRep { 78 | let rectSub = CGRect(x: (index % 4) * 100, y: Int(index / 4) * 100, width: 100, height:100) 79 | 80 | imgA.draw(in: rectSub, from: CGRect(x: 0, y: 0, width: bitmap.size.width, height:bitmap.size.height), operation: .sourceOver, fraction: 1.0) 81 | 82 | index = index + 1 83 | } 84 | } 85 | 86 | } 87 | indextries = indextries + 1 88 | print(indextries) 89 | } while (index < 16 && indextries < 50) 90 | 91 | NSGraphicsContext.restoreGraphicsState() 92 | 93 | let image = NSImage(size: rect.size) 94 | image.addRepresentation(rep!) 95 | 96 | if let bits = image.representations.first as? NSBitmapImageRep { 97 | let data = bits.representation(using:.JPEG, properties: [:]) 98 | 99 | do { 100 | let documentDirectoryURL = URL(fileURLWithPath:currentPath) 101 | let fileDestinationUrl = documentDirectoryURL.appendingPathComponent("collage.jpg") 102 | try data?.write(to: fileDestinationUrl, options: .atomic) 103 | } catch { 104 | print(error) 105 | } 106 | } 107 | 108 | } 109 | } 110 | } 111 | 112 | task.resume() 113 | RunLoop.main.run() 114 | -------------------------------------------------------------------------------- /Scripts/BuildScript/build.swift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/swift -target x86_64-macosx10.12 2 | 3 | // Written at SwiftAlps 2016 by Robert-Hein and Roger. 4 | 5 | import Foundation 6 | 7 | let separator = "%%" 8 | let currentPath = FileManager.default.currentDirectoryPath 9 | let platform = "platform=iOS\(separator)Simulator,OS=10.1,name=iPhone\(separator)7" 10 | let sdk = "iphonesimulator10.1" 11 | 12 | func shell(_ command: String) { 13 | var arguments = command.components(separatedBy: " ") 14 | arguments = arguments.map { $0.replacingOccurrences(of: separator, with: " ") } 15 | let process = Process() 16 | process.launchPath = "/usr/bin/env" 17 | process.arguments = arguments 18 | process.launch() 19 | process.waitUntilExit() 20 | } 21 | 22 | print("Enter project name:") 23 | 24 | if let userInput = readLine() { 25 | shell("xcodebuild -project \(currentPath)/\(userInput)/\(userInput).xcodeproj -scheme \(userInput) -sdk \(sdk) -destination \(platform) clean build test") 26 | } 27 | -------------------------------------------------------------------------------- /Scripts/Colors/Colors.swift: -------------------------------------------------------------------------------- 1 | struct Colors { 2 | 3 | static let magenta = UIColor(hexString: "#11FF00") 4 | 5 | static let green = UIColor(hexString: "#00FF00") 6 | 7 | static let red = UIColor(hexString: "#FF0000") 8 | 9 | static let blue = UIColor(hexString: "#0000FF") 10 | 11 | } 12 | 13 | extension UIColor { 14 | convenience init(hexString:String) { 15 | let hexString:NSString = hexString.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) 16 | let scanner = NSScanner(string: hexString) 17 | 18 | if (hexString.hasPrefix("#")) { 19 | scanner.scanLocation = 1 20 | } 21 | 22 | var color:UInt32 = 0 23 | scanner.scanHexInt(&color) 24 | 25 | let mask = 0x000000FF 26 | let r = Int(color >> 16) & mask 27 | let g = Int(color >> 8) & mask 28 | let b = Int(color) & mask 29 | 30 | let red = CGFloat(r) / 255.0 31 | let green = CGFloat(g) / 255.0 32 | let blue = CGFloat(b) / 255.0 33 | 34 | self.init(red:red, green:green, blue:blue, alpha:1) 35 | } 36 | } -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/PathKit.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/PathKit.framework/Modules: -------------------------------------------------------------------------------- 1 | Versions/Current/Modules -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/PathKit.framework/PathKit: -------------------------------------------------------------------------------- 1 | Versions/Current/PathKit -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/PathKit.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/PathKit.framework/Versions/A/Headers/PathKit-Swift.h: -------------------------------------------------------------------------------- 1 | // Generated by Apple Swift version 3.0.1 (swiftlang-800.0.58.6 clang-800.0.42.1) 2 | #pragma clang diagnostic push 3 | 4 | #if defined(__has_include) && __has_include() 5 | # include 6 | #endif 7 | 8 | #pragma clang diagnostic ignored "-Wauto-import" 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #if !defined(SWIFT_TYPEDEFS) 15 | # define SWIFT_TYPEDEFS 1 16 | # if defined(__has_include) && __has_include() 17 | # include 18 | # elif !defined(__cplusplus) || __cplusplus < 201103L 19 | typedef uint_least16_t char16_t; 20 | typedef uint_least32_t char32_t; 21 | # endif 22 | typedef float swift_float2 __attribute__((__ext_vector_type__(2))); 23 | typedef float swift_float3 __attribute__((__ext_vector_type__(3))); 24 | typedef float swift_float4 __attribute__((__ext_vector_type__(4))); 25 | typedef double swift_double2 __attribute__((__ext_vector_type__(2))); 26 | typedef double swift_double3 __attribute__((__ext_vector_type__(3))); 27 | typedef double swift_double4 __attribute__((__ext_vector_type__(4))); 28 | typedef int swift_int2 __attribute__((__ext_vector_type__(2))); 29 | typedef int swift_int3 __attribute__((__ext_vector_type__(3))); 30 | typedef int swift_int4 __attribute__((__ext_vector_type__(4))); 31 | typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); 32 | typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); 33 | typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); 34 | #endif 35 | 36 | #if !defined(SWIFT_PASTE) 37 | # define SWIFT_PASTE_HELPER(x, y) x##y 38 | # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) 39 | #endif 40 | #if !defined(SWIFT_METATYPE) 41 | # define SWIFT_METATYPE(X) Class 42 | #endif 43 | #if !defined(SWIFT_CLASS_PROPERTY) 44 | # if __has_feature(objc_class_property) 45 | # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ 46 | # else 47 | # define SWIFT_CLASS_PROPERTY(...) 48 | # endif 49 | #endif 50 | 51 | #if defined(__has_attribute) && __has_attribute(objc_runtime_name) 52 | # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) 53 | #else 54 | # define SWIFT_RUNTIME_NAME(X) 55 | #endif 56 | #if defined(__has_attribute) && __has_attribute(swift_name) 57 | # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) 58 | #else 59 | # define SWIFT_COMPILE_NAME(X) 60 | #endif 61 | #if defined(__has_attribute) && __has_attribute(objc_method_family) 62 | # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) 63 | #else 64 | # define SWIFT_METHOD_FAMILY(X) 65 | #endif 66 | #if defined(__has_attribute) && __has_attribute(noescape) 67 | # define SWIFT_NOESCAPE __attribute__((noescape)) 68 | #else 69 | # define SWIFT_NOESCAPE 70 | #endif 71 | #if !defined(SWIFT_CLASS_EXTRA) 72 | # define SWIFT_CLASS_EXTRA 73 | #endif 74 | #if !defined(SWIFT_PROTOCOL_EXTRA) 75 | # define SWIFT_PROTOCOL_EXTRA 76 | #endif 77 | #if !defined(SWIFT_ENUM_EXTRA) 78 | # define SWIFT_ENUM_EXTRA 79 | #endif 80 | #if !defined(SWIFT_CLASS) 81 | # if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) 82 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA 83 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 84 | # else 85 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 86 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 87 | # endif 88 | #endif 89 | 90 | #if !defined(SWIFT_PROTOCOL) 91 | # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 92 | # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 93 | #endif 94 | 95 | #if !defined(SWIFT_EXTENSION) 96 | # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) 97 | #endif 98 | 99 | #if !defined(OBJC_DESIGNATED_INITIALIZER) 100 | # if defined(__has_attribute) && __has_attribute(objc_designated_initializer) 101 | # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 102 | # else 103 | # define OBJC_DESIGNATED_INITIALIZER 104 | # endif 105 | #endif 106 | #if !defined(SWIFT_ENUM) 107 | # define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type 108 | # if defined(__has_feature) && __has_feature(generalized_swift_name) 109 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_EXTRA _name : _type 110 | # else 111 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name) 112 | # endif 113 | #endif 114 | #if !defined(SWIFT_UNAVAILABLE) 115 | # define SWIFT_UNAVAILABLE __attribute__((unavailable)) 116 | #endif 117 | #if defined(__has_feature) && __has_feature(modules) 118 | #endif 119 | 120 | #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" 121 | #pragma clang diagnostic ignored "-Wduplicate-method-arg" 122 | #pragma clang diagnostic pop 123 | -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/PathKit.framework/Versions/A/Headers/PathKit-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double PathKitVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char PathKitVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/PathKit.framework/Versions/A/Modules/PathKit.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Colors/Frameworks/PathKit.framework/Versions/A/Modules/PathKit.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/PathKit.framework/Versions/A/Modules/PathKit.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Colors/Frameworks/PathKit.framework/Versions/A/Modules/PathKit.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/PathKit.framework/Versions/A/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module PathKit { 2 | umbrella header "PathKit-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module PathKit.Swift { 9 | header "PathKit-Swift.h" 10 | } 11 | -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/PathKit.framework/Versions/A/PathKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Colors/Frameworks/PathKit.framework/Versions/A/PathKit -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/PathKit.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 16B2555 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | PathKit 11 | CFBundleIdentifier 12 | org.cocoapods.PathKit 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | PathKit 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.7.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 8B62 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 16B2649 37 | DTSDKName 38 | macosx10.12 39 | DTXcode 40 | 0810 41 | DTXcodeBuild 42 | 8B62 43 | 44 | 45 | -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/PathKit.framework/Versions/A/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | YvR9fh64LSvNtOLQJaeQg/fnvIQ= 10 | 11 | 12 | files2 13 | 14 | Headers/PathKit-Swift.h 15 | 16 | hash 17 | 18 | xdGV6y7g7JxExjKmnkMj4DF9tlo= 19 | 20 | hash2 21 | 22 | JknOEWPQw5rITehbZtubGElw59+hVDaUEmHZfOn0OGk= 23 | 24 | 25 | Headers/PathKit-umbrella.h 26 | 27 | hash 28 | 29 | sgDX25wUaDygfq1CqaTEXIsCtZ4= 30 | 31 | hash2 32 | 33 | vq6lFbUM4FtD7EMSy8pnTbQELfLojAT0TN5F0fI4h4g= 34 | 35 | 36 | Modules/PathKit.swiftmodule/x86_64.swiftdoc 37 | 38 | hash 39 | 40 | tsG37fHgjQq3Ckq7j7Kxok0AVEk= 41 | 42 | hash2 43 | 44 | 0pyJxt+x4hVLbC1pRz6uqVlntIzSwqqYZPRvX/LQr/U= 45 | 46 | 47 | Modules/PathKit.swiftmodule/x86_64.swiftmodule 48 | 49 | hash 50 | 51 | LViUGibV3OdvoZQCVQxj9ASWh4k= 52 | 53 | hash2 54 | 55 | pNwpNnTqxjFu9/+o1wpxzGZkomuMUgdUK+BF5cFQ7r0= 56 | 57 | 58 | Modules/module.modulemap 59 | 60 | hash 61 | 62 | RN1bHSFqr2gaCVdts5YoqrTFgu8= 63 | 64 | hash2 65 | 66 | vdjgkqfvx65x4gmrHukwXh5fAk8c55MUvePCU3/FPAY= 67 | 68 | 69 | Resources/Info.plist 70 | 71 | hash 72 | 73 | YvR9fh64LSvNtOLQJaeQg/fnvIQ= 74 | 75 | hash2 76 | 77 | sBgkxSgkBMad8DIn6GW3lobx5Fh5fBMlFt3wpSS1SwA= 78 | 79 | 80 | 81 | rules 82 | 83 | ^Resources/ 84 | 85 | ^Resources/.*\.lproj/ 86 | 87 | optional 88 | 89 | weight 90 | 1000 91 | 92 | ^Resources/.*\.lproj/locversion.plist$ 93 | 94 | omit 95 | 96 | weight 97 | 1100 98 | 99 | ^Resources/Base\.lproj/ 100 | 101 | weight 102 | 1010 103 | 104 | ^version.plist$ 105 | 106 | 107 | rules2 108 | 109 | .*\.dSYM($|/) 110 | 111 | weight 112 | 11 113 | 114 | ^(.*/)?\.DS_Store$ 115 | 116 | omit 117 | 118 | weight 119 | 2000 120 | 121 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 122 | 123 | nested 124 | 125 | weight 126 | 10 127 | 128 | ^.* 129 | 130 | ^Info\.plist$ 131 | 132 | omit 133 | 134 | weight 135 | 20 136 | 137 | ^PkgInfo$ 138 | 139 | omit 140 | 141 | weight 142 | 20 143 | 144 | ^Resources/ 145 | 146 | weight 147 | 20 148 | 149 | ^Resources/.*\.lproj/ 150 | 151 | optional 152 | 153 | weight 154 | 1000 155 | 156 | ^Resources/.*\.lproj/locversion.plist$ 157 | 158 | omit 159 | 160 | weight 161 | 1100 162 | 163 | ^Resources/Base\.lproj/ 164 | 165 | weight 166 | 1010 167 | 168 | ^[^/]+$ 169 | 170 | nested 171 | 172 | weight 173 | 10 174 | 175 | ^embedded\.provisionprofile$ 176 | 177 | weight 178 | 20 179 | 180 | ^version\.plist$ 181 | 182 | weight 183 | 20 184 | 185 | 186 | 187 | 188 | -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/PathKit.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/Stencil.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/Stencil.framework/Modules: -------------------------------------------------------------------------------- 1 | Versions/Current/Modules -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/Stencil.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/Stencil.framework/Stencil: -------------------------------------------------------------------------------- 1 | Versions/Current/Stencil -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/Stencil.framework/Versions/A/Headers/Stencil-Swift.h: -------------------------------------------------------------------------------- 1 | // Generated by Apple Swift version 3.0.1 (swiftlang-800.0.58.6 clang-800.0.42.1) 2 | #pragma clang diagnostic push 3 | 4 | #if defined(__has_include) && __has_include() 5 | # include 6 | #endif 7 | 8 | #pragma clang diagnostic ignored "-Wauto-import" 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #if !defined(SWIFT_TYPEDEFS) 15 | # define SWIFT_TYPEDEFS 1 16 | # if defined(__has_include) && __has_include() 17 | # include 18 | # elif !defined(__cplusplus) || __cplusplus < 201103L 19 | typedef uint_least16_t char16_t; 20 | typedef uint_least32_t char32_t; 21 | # endif 22 | typedef float swift_float2 __attribute__((__ext_vector_type__(2))); 23 | typedef float swift_float3 __attribute__((__ext_vector_type__(3))); 24 | typedef float swift_float4 __attribute__((__ext_vector_type__(4))); 25 | typedef double swift_double2 __attribute__((__ext_vector_type__(2))); 26 | typedef double swift_double3 __attribute__((__ext_vector_type__(3))); 27 | typedef double swift_double4 __attribute__((__ext_vector_type__(4))); 28 | typedef int swift_int2 __attribute__((__ext_vector_type__(2))); 29 | typedef int swift_int3 __attribute__((__ext_vector_type__(3))); 30 | typedef int swift_int4 __attribute__((__ext_vector_type__(4))); 31 | typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); 32 | typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); 33 | typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); 34 | #endif 35 | 36 | #if !defined(SWIFT_PASTE) 37 | # define SWIFT_PASTE_HELPER(x, y) x##y 38 | # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) 39 | #endif 40 | #if !defined(SWIFT_METATYPE) 41 | # define SWIFT_METATYPE(X) Class 42 | #endif 43 | #if !defined(SWIFT_CLASS_PROPERTY) 44 | # if __has_feature(objc_class_property) 45 | # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ 46 | # else 47 | # define SWIFT_CLASS_PROPERTY(...) 48 | # endif 49 | #endif 50 | 51 | #if defined(__has_attribute) && __has_attribute(objc_runtime_name) 52 | # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) 53 | #else 54 | # define SWIFT_RUNTIME_NAME(X) 55 | #endif 56 | #if defined(__has_attribute) && __has_attribute(swift_name) 57 | # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) 58 | #else 59 | # define SWIFT_COMPILE_NAME(X) 60 | #endif 61 | #if defined(__has_attribute) && __has_attribute(objc_method_family) 62 | # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) 63 | #else 64 | # define SWIFT_METHOD_FAMILY(X) 65 | #endif 66 | #if defined(__has_attribute) && __has_attribute(noescape) 67 | # define SWIFT_NOESCAPE __attribute__((noescape)) 68 | #else 69 | # define SWIFT_NOESCAPE 70 | #endif 71 | #if !defined(SWIFT_CLASS_EXTRA) 72 | # define SWIFT_CLASS_EXTRA 73 | #endif 74 | #if !defined(SWIFT_PROTOCOL_EXTRA) 75 | # define SWIFT_PROTOCOL_EXTRA 76 | #endif 77 | #if !defined(SWIFT_ENUM_EXTRA) 78 | # define SWIFT_ENUM_EXTRA 79 | #endif 80 | #if !defined(SWIFT_CLASS) 81 | # if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) 82 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA 83 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 84 | # else 85 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 86 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 87 | # endif 88 | #endif 89 | 90 | #if !defined(SWIFT_PROTOCOL) 91 | # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 92 | # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 93 | #endif 94 | 95 | #if !defined(SWIFT_EXTENSION) 96 | # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) 97 | #endif 98 | 99 | #if !defined(OBJC_DESIGNATED_INITIALIZER) 100 | # if defined(__has_attribute) && __has_attribute(objc_designated_initializer) 101 | # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 102 | # else 103 | # define OBJC_DESIGNATED_INITIALIZER 104 | # endif 105 | #endif 106 | #if !defined(SWIFT_ENUM) 107 | # define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type 108 | # if defined(__has_feature) && __has_feature(generalized_swift_name) 109 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_EXTRA _name : _type 110 | # else 111 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name) 112 | # endif 113 | #endif 114 | #if !defined(SWIFT_UNAVAILABLE) 115 | # define SWIFT_UNAVAILABLE __attribute__((unavailable)) 116 | #endif 117 | #if defined(__has_feature) && __has_feature(modules) 118 | @import Foundation; 119 | #endif 120 | 121 | #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" 122 | #pragma clang diagnostic ignored "-Wduplicate-method-arg" 123 | 124 | @interface NSArray (SWIFT_EXTENSION(Stencil)) 125 | @end 126 | 127 | #pragma clang diagnostic pop 128 | -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/Stencil.framework/Versions/A/Headers/Stencil-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double StencilVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char StencilVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/Stencil.framework/Versions/A/Modules/Stencil.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Colors/Frameworks/Stencil.framework/Versions/A/Modules/Stencil.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/Stencil.framework/Versions/A/Modules/Stencil.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Colors/Frameworks/Stencil.framework/Versions/A/Modules/Stencil.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/Stencil.framework/Versions/A/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module Stencil { 2 | umbrella header "Stencil-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module Stencil.Swift { 9 | header "Stencil-Swift.h" 10 | } 11 | -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/Stencil.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 16B2555 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Stencil 11 | CFBundleIdentifier 12 | org.cocoapods.Stencil 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Stencil 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.6.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 8B62 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 16B2649 37 | DTSDKName 38 | macosx10.12 39 | DTXcode 40 | 0810 41 | DTXcodeBuild 42 | 8B62 43 | 44 | 45 | -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/Stencil.framework/Versions/A/Stencil: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Colors/Frameworks/Stencil.framework/Versions/A/Stencil -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/Stencil.framework/Versions/A/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | AlFLxat/7OTyQdxBZpJkfmclhe4= 10 | 11 | 12 | files2 13 | 14 | Headers/Stencil-Swift.h 15 | 16 | hash 17 | 18 | v3h7+3kWBOj3uDqdlHnG3xTmALA= 19 | 20 | hash2 21 | 22 | rsMD/YJiZ7L8IW1Fm/+Mn4okWZMJR43gpH++zs6wIGo= 23 | 24 | 25 | Headers/Stencil-umbrella.h 26 | 27 | hash 28 | 29 | itM627YE9fzSkjAAeBcJt0LlIN4= 30 | 31 | hash2 32 | 33 | pKRBIzqZUiL0Hr8xmL1BNorAkcE/TmUbYpYb8n4DXUo= 34 | 35 | 36 | Modules/Stencil.swiftmodule/x86_64.swiftdoc 37 | 38 | hash 39 | 40 | 0LK3y4uYzBzckZOArcEkk624jMo= 41 | 42 | hash2 43 | 44 | C74O5Ogc5otDFXZ2lxejPLOVrSo7zlB+FZThL+Rp9ps= 45 | 46 | 47 | Modules/Stencil.swiftmodule/x86_64.swiftmodule 48 | 49 | hash 50 | 51 | jN7adHWZ4aT59cn4QWN/f+rBxO0= 52 | 53 | hash2 54 | 55 | Z7T38j3Uyp8DmpK+Z4mzl+2euc/lEQDMS5ZxzZOW6nM= 56 | 57 | 58 | Modules/module.modulemap 59 | 60 | hash 61 | 62 | Lf6ITJQDWYUiSV+32PZHZvH6Wns= 63 | 64 | hash2 65 | 66 | T6kuRe95Fus6HVJo7pWD/JBCr+DN76BbLbtAskV5yIM= 67 | 68 | 69 | Resources/Info.plist 70 | 71 | hash 72 | 73 | AlFLxat/7OTyQdxBZpJkfmclhe4= 74 | 75 | hash2 76 | 77 | ojBr11zKA7K/rJOiTQKpoqjXxLlqCuQaptg4iFtK7tU= 78 | 79 | 80 | 81 | rules 82 | 83 | ^Resources/ 84 | 85 | ^Resources/.*\.lproj/ 86 | 87 | optional 88 | 89 | weight 90 | 1000 91 | 92 | ^Resources/.*\.lproj/locversion.plist$ 93 | 94 | omit 95 | 96 | weight 97 | 1100 98 | 99 | ^Resources/Base\.lproj/ 100 | 101 | weight 102 | 1010 103 | 104 | ^version.plist$ 105 | 106 | 107 | rules2 108 | 109 | .*\.dSYM($|/) 110 | 111 | weight 112 | 11 113 | 114 | ^(.*/)?\.DS_Store$ 115 | 116 | omit 117 | 118 | weight 119 | 2000 120 | 121 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 122 | 123 | nested 124 | 125 | weight 126 | 10 127 | 128 | ^.* 129 | 130 | ^Info\.plist$ 131 | 132 | omit 133 | 134 | weight 135 | 20 136 | 137 | ^PkgInfo$ 138 | 139 | omit 140 | 141 | weight 142 | 20 143 | 144 | ^Resources/ 145 | 146 | weight 147 | 20 148 | 149 | ^Resources/.*\.lproj/ 150 | 151 | optional 152 | 153 | weight 154 | 1000 155 | 156 | ^Resources/.*\.lproj/locversion.plist$ 157 | 158 | omit 159 | 160 | weight 161 | 1100 162 | 163 | ^Resources/Base\.lproj/ 164 | 165 | weight 166 | 1010 167 | 168 | ^[^/]+$ 169 | 170 | nested 171 | 172 | weight 173 | 10 174 | 175 | ^embedded\.provisionprofile$ 176 | 177 | weight 178 | 20 179 | 180 | ^version\.plist$ 181 | 182 | weight 183 | 20 184 | 185 | 186 | 187 | 188 | -------------------------------------------------------------------------------- /Scripts/Colors/Frameworks/Stencil.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Scripts/Colors/ScriptSwift.playground/Contents.swift: -------------------------------------------------------------------------------- 1 | //: Playground - noun: a place where people can play 2 | 3 | import UIKit 4 | 5 | 6 | JSONSerialization.jsonObject(with: <#T##Data#>, options: <#T##JSONSerialization.ReadingOptions#>) -------------------------------------------------------------------------------- /Scripts/Colors/ScriptSwift.playground/contents.xcplayground: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Scripts/Colors/colors.json: -------------------------------------------------------------------------------- 1 | { 2 | "blue" : "#0000FF", 3 | "red" : "#FF0000", 4 | "green" : "#00FF00", 5 | "magenta" : "#11FF00" 6 | } -------------------------------------------------------------------------------- /Scripts/Colors/colorstemplate.stencil: -------------------------------------------------------------------------------- 1 | struct Colors { 2 | {% for color in colors %} 3 | static let {{ color.name }} = UIColor(hexString: "{{ color.hex }}") 4 | {% endfor %} 5 | } 6 | 7 | extension UIColor { 8 | convenience init(hexString:String) { 9 | let hexString:NSString = hexString.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) 10 | let scanner = NSScanner(string: hexString) 11 | 12 | if (hexString.hasPrefix("#")) { 13 | scanner.scanLocation = 1 14 | } 15 | 16 | var color:UInt32 = 0 17 | scanner.scanHexInt(&color) 18 | 19 | let mask = 0x000000FF 20 | let r = Int(color >> 16) & mask 21 | let g = Int(color >> 8) & mask 22 | let b = Int(color) & mask 23 | 24 | let red = CGFloat(r) / 255.0 25 | let green = CGFloat(g) / 255.0 26 | let blue = CGFloat(b) / 255.0 27 | 28 | self.init(red:red, green:green, blue:blue, alpha:1) 29 | } 30 | } -------------------------------------------------------------------------------- /Scripts/Colors/main.swift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/swift -target x86_64-macosx10.12 -F /Library/Frameworks -F Frameworks 2 | 3 | import Foundation 4 | import Stencil 5 | import Darwin 6 | 7 | func returnWithError(_ error: String) -> Never { 8 | fputs("\(error)\n", __stderrp) 9 | exit(0) 10 | } 11 | 12 | let args = CommandLine.arguments 13 | var jsonFileName = "colors.json" 14 | var outputFileName: String? 15 | 16 | if args.count > 1 { 17 | jsonFileName = args[1] 18 | } 19 | 20 | if args.count > 2 { 21 | outputFileName = args[2] 22 | } 23 | 24 | // reading file 25 | let currentPath = FileManager.default.currentDirectoryPath 26 | var jsonURL = URL(fileURLWithPath: currentPath) 27 | jsonURL.appendPathComponent(jsonFileName) 28 | 29 | // parsing json 30 | let json: [String:String] 31 | do { 32 | let data = try Data.init(contentsOf: jsonURL) 33 | guard let parsedJson = try JSONSerialization.jsonObject(with: data) as? [String:String] else { 34 | returnWithError("Can't parse to JSON'") 35 | } 36 | json = parsedJson 37 | } catch let error { 38 | returnWithError("reading error \(error)") 39 | } 40 | 41 | let context = Context(dictionary: ["colors": json.map { (key, value) in 42 | ["name": key, "hex": value] 43 | }]) 44 | 45 | do { 46 | let template = try Template(path: "colorstemplate.stencil") 47 | let rendered = try template.render(context) 48 | 49 | if let outputFileName = outputFileName { 50 | var outputFile = URL(fileURLWithPath: currentPath) 51 | outputFile.appendPathComponent(outputFileName) 52 | try rendered.write(to: outputFile, atomically: true, encoding: .utf8) 53 | print("Success!") 54 | } else { 55 | print(rendered) 56 | } 57 | } catch { 58 | returnWithError("Failed to render template \(error)") 59 | } -------------------------------------------------------------------------------- /Scripts/EmojiQuiz/emojiquiz.swift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/swift 2 | 3 | // Swift Alps 2016 - Swift Scripting 4 | // @ikhsan & @kaalita. mentor: @marmelroy 5 | 6 | import Foundation 7 | 8 | struct Artist { 9 | let name: String 10 | let emoji: String 11 | let uri: String 12 | } 13 | 14 | let artists = [ 15 | Artist(name: "Arctic Monkeys", emoji: "❄️ 🐒 🐒", uri: "spotify:track:3jfr0TF6DQcOLat8gGn7E2"), 16 | Artist(name: "Radiohead", emoji: "📻 👤", uri: "spotify:track:3SVAN3BRByDmHOhKyIDxfC"), 17 | Artist(name: "ZZ Top", emoji: "💤🎩", uri: "spotify:track:1UBQ5GK8JaQjm5VbkBZY66"), 18 | ] 19 | 20 | func play(_ artist: Artist) { 21 | let script = NSAppleScript(source: "tell application \"Spotify\" to play track \"\(artist.uri)\"") 22 | script?.executeAndReturnError(nil) 23 | } 24 | 25 | print("Welcome to 🤓 Band Quiz!") 26 | print("Can you guess the band?") 27 | 28 | 29 | let i = arc4random_uniform(UInt32(artists.count)) 30 | let question = artists[Int(i)] 31 | 32 | print(question.emoji) 33 | let answer1 = readLine() ?? "" 34 | if answer1.lowercased() == question.name.lowercased() 35 | { 36 | print("YEAH, you rock!") 37 | play(question) 38 | } 39 | else 40 | { 41 | print("D'Oh, try again.") 42 | } -------------------------------------------------------------------------------- /Scripts/Giffer/Gif/GifMaker.framework/GifMaker: -------------------------------------------------------------------------------- 1 | Versions/Current/GifMaker -------------------------------------------------------------------------------- /Scripts/Giffer/Gif/GifMaker.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /Scripts/Giffer/Gif/GifMaker.framework/Modules: -------------------------------------------------------------------------------- 1 | Versions/Current/Modules -------------------------------------------------------------------------------- /Scripts/Giffer/Gif/GifMaker.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Scripts/Giffer/Gif/GifMaker.framework/Versions/A/GifMaker: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Giffer/Gif/GifMaker.framework/Versions/A/GifMaker -------------------------------------------------------------------------------- /Scripts/Giffer/Gif/GifMaker.framework/Versions/A/Headers/GifMaker-Swift.h: -------------------------------------------------------------------------------- 1 | // Generated by Apple Swift version 3.0.1 (swiftlang-800.0.58.6 clang-800.0.42.1) 2 | #pragma clang diagnostic push 3 | 4 | #if defined(__has_include) && __has_include() 5 | # include 6 | #endif 7 | 8 | #pragma clang diagnostic ignored "-Wauto-import" 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #if !defined(SWIFT_TYPEDEFS) 15 | # define SWIFT_TYPEDEFS 1 16 | # if defined(__has_include) && __has_include() 17 | # include 18 | # elif !defined(__cplusplus) || __cplusplus < 201103L 19 | typedef uint_least16_t char16_t; 20 | typedef uint_least32_t char32_t; 21 | # endif 22 | typedef float swift_float2 __attribute__((__ext_vector_type__(2))); 23 | typedef float swift_float3 __attribute__((__ext_vector_type__(3))); 24 | typedef float swift_float4 __attribute__((__ext_vector_type__(4))); 25 | typedef double swift_double2 __attribute__((__ext_vector_type__(2))); 26 | typedef double swift_double3 __attribute__((__ext_vector_type__(3))); 27 | typedef double swift_double4 __attribute__((__ext_vector_type__(4))); 28 | typedef int swift_int2 __attribute__((__ext_vector_type__(2))); 29 | typedef int swift_int3 __attribute__((__ext_vector_type__(3))); 30 | typedef int swift_int4 __attribute__((__ext_vector_type__(4))); 31 | typedef unsigned int swift_uint2 __attribute__((__ext_vector_type__(2))); 32 | typedef unsigned int swift_uint3 __attribute__((__ext_vector_type__(3))); 33 | typedef unsigned int swift_uint4 __attribute__((__ext_vector_type__(4))); 34 | #endif 35 | 36 | #if !defined(SWIFT_PASTE) 37 | # define SWIFT_PASTE_HELPER(x, y) x##y 38 | # define SWIFT_PASTE(x, y) SWIFT_PASTE_HELPER(x, y) 39 | #endif 40 | #if !defined(SWIFT_METATYPE) 41 | # define SWIFT_METATYPE(X) Class 42 | #endif 43 | #if !defined(SWIFT_CLASS_PROPERTY) 44 | # if __has_feature(objc_class_property) 45 | # define SWIFT_CLASS_PROPERTY(...) __VA_ARGS__ 46 | # else 47 | # define SWIFT_CLASS_PROPERTY(...) 48 | # endif 49 | #endif 50 | 51 | #if defined(__has_attribute) && __has_attribute(objc_runtime_name) 52 | # define SWIFT_RUNTIME_NAME(X) __attribute__((objc_runtime_name(X))) 53 | #else 54 | # define SWIFT_RUNTIME_NAME(X) 55 | #endif 56 | #if defined(__has_attribute) && __has_attribute(swift_name) 57 | # define SWIFT_COMPILE_NAME(X) __attribute__((swift_name(X))) 58 | #else 59 | # define SWIFT_COMPILE_NAME(X) 60 | #endif 61 | #if defined(__has_attribute) && __has_attribute(objc_method_family) 62 | # define SWIFT_METHOD_FAMILY(X) __attribute__((objc_method_family(X))) 63 | #else 64 | # define SWIFT_METHOD_FAMILY(X) 65 | #endif 66 | #if defined(__has_attribute) && __has_attribute(noescape) 67 | # define SWIFT_NOESCAPE __attribute__((noescape)) 68 | #else 69 | # define SWIFT_NOESCAPE 70 | #endif 71 | #if !defined(SWIFT_CLASS_EXTRA) 72 | # define SWIFT_CLASS_EXTRA 73 | #endif 74 | #if !defined(SWIFT_PROTOCOL_EXTRA) 75 | # define SWIFT_PROTOCOL_EXTRA 76 | #endif 77 | #if !defined(SWIFT_ENUM_EXTRA) 78 | # define SWIFT_ENUM_EXTRA 79 | #endif 80 | #if !defined(SWIFT_CLASS) 81 | # if defined(__has_attribute) && __has_attribute(objc_subclassing_restricted) 82 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_CLASS_EXTRA 83 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) __attribute__((objc_subclassing_restricted)) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 84 | # else 85 | # define SWIFT_CLASS(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 86 | # define SWIFT_CLASS_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_CLASS_EXTRA 87 | # endif 88 | #endif 89 | 90 | #if !defined(SWIFT_PROTOCOL) 91 | # define SWIFT_PROTOCOL(SWIFT_NAME) SWIFT_RUNTIME_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 92 | # define SWIFT_PROTOCOL_NAMED(SWIFT_NAME) SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_PROTOCOL_EXTRA 93 | #endif 94 | 95 | #if !defined(SWIFT_EXTENSION) 96 | # define SWIFT_EXTENSION(M) SWIFT_PASTE(M##_Swift_, __LINE__) 97 | #endif 98 | 99 | #if !defined(OBJC_DESIGNATED_INITIALIZER) 100 | # if defined(__has_attribute) && __has_attribute(objc_designated_initializer) 101 | # define OBJC_DESIGNATED_INITIALIZER __attribute__((objc_designated_initializer)) 102 | # else 103 | # define OBJC_DESIGNATED_INITIALIZER 104 | # endif 105 | #endif 106 | #if !defined(SWIFT_ENUM) 107 | # define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_EXTRA _name : _type 108 | # if defined(__has_feature) && __has_feature(generalized_swift_name) 109 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_EXTRA _name : _type 110 | # else 111 | # define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name) 112 | # endif 113 | #endif 114 | #if !defined(SWIFT_UNAVAILABLE) 115 | # define SWIFT_UNAVAILABLE __attribute__((unavailable)) 116 | #endif 117 | #if defined(__has_feature) && __has_feature(modules) 118 | #endif 119 | 120 | #pragma clang diagnostic ignored "-Wproperty-attribute-mismatch" 121 | #pragma clang diagnostic ignored "-Wduplicate-method-arg" 122 | #pragma clang diagnostic pop 123 | -------------------------------------------------------------------------------- /Scripts/Giffer/Gif/GifMaker.framework/Versions/A/Headers/GifMaker.h: -------------------------------------------------------------------------------- 1 | // 2 | // GifMaker.h 3 | // GifMaker 4 | // 5 | // Created by Igor Ranieri on 10/11/2016. 6 | // Copyright © 2016 ch.seriot. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for GifMaker. 12 | FOUNDATION_EXPORT double GifMakerVersionNumber; 13 | 14 | //! Project version string for GifMaker. 15 | FOUNDATION_EXPORT const unsigned char GifMakerVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Scripts/Giffer/Gif/GifMaker.framework/Versions/A/Modules/GifMaker.swiftmodule/x86_64.swiftdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Giffer/Gif/GifMaker.framework/Versions/A/Modules/GifMaker.swiftmodule/x86_64.swiftdoc -------------------------------------------------------------------------------- /Scripts/Giffer/Gif/GifMaker.framework/Versions/A/Modules/GifMaker.swiftmodule/x86_64.swiftmodule: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Giffer/Gif/GifMaker.framework/Versions/A/Modules/GifMaker.swiftmodule/x86_64.swiftmodule -------------------------------------------------------------------------------- /Scripts/Giffer/Gif/GifMaker.framework/Versions/A/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module GifMaker { 2 | umbrella header "GifMaker.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | 8 | module GifMaker.Swift { 9 | header "GifMaker-Swift.h" 10 | } 11 | -------------------------------------------------------------------------------- /Scripts/Giffer/Gif/GifMaker.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 16B2555 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | GifMaker 11 | CFBundleIdentifier 12 | me.elland.GifMaker 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | GifMaker 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSupportedPlatforms 22 | 23 | MacOSX 24 | 25 | CFBundleVersion 26 | 1 27 | DTCompiler 28 | com.apple.compilers.llvm.clang.1_0 29 | DTPlatformBuild 30 | 8B62 31 | DTPlatformVersion 32 | GM 33 | DTSDKBuild 34 | 16B2649 35 | DTSDKName 36 | macosx10.12 37 | DTXcode 38 | 0810 39 | DTXcodeBuild 40 | 8B62 41 | NSHumanReadableCopyright 42 | Copyright © 2016 ch.seriot. All rights reserved. 43 | 44 | 45 | -------------------------------------------------------------------------------- /Scripts/Giffer/Gif/GifMaker.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Scripts/Giffer/giffer.swift: -------------------------------------------------------------------------------- 1 | #!/usr/bin/swift -target x86_64-macosx10.12 -F /Library/Frameworks -F ./Gif 2 | 3 | import Foundation 4 | import GifMaker 5 | import AppKit 6 | 7 | if CommandLine.arguments.count == 1 { 8 | print("usage here") 9 | 10 | exit(1) 11 | } 12 | 13 | let inputFolder = CommandLine.arguments[1] 14 | let destinationPath = CommandLine.arguments[2] 15 | let duration = Double(CommandLine.arguments[3]) ?? 0.5 16 | 17 | let gm = STGIFMaker(destinationPath: destinationPath, loop: true)! 18 | 19 | let images = try! FileManager.default.contentsOfDirectory(atPath: inputFolder).filter { n in n.hasSuffix("jpeg") } 20 | 21 | for i in images { 22 | let image = NSImage(contentsOfFile: inputFolder.appending("/\(i)"))! 23 | gm.append(image: image, duration: duration) 24 | } 25 | 26 | exit(gm.write()) 27 | -------------------------------------------------------------------------------- /Scripts/Giffer/images/source-1 (dragged).jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Giffer/images/source-1 (dragged).jpeg -------------------------------------------------------------------------------- /Scripts/Giffer/images/source-2 (dragged).jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Giffer/images/source-2 (dragged).jpeg -------------------------------------------------------------------------------- /Scripts/Giffer/images/source-3 (dragged).jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Giffer/images/source-3 (dragged).jpeg -------------------------------------------------------------------------------- /Scripts/Giffer/images/source-4 (dragged).jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Giffer/images/source-4 (dragged).jpeg -------------------------------------------------------------------------------- /Scripts/Giffer/images/source-5 (dragged).jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Giffer/images/source-5 (dragged).jpeg -------------------------------------------------------------------------------- /Scripts/Giffer/images/source-6 (dragged).jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Giffer/images/source-6 (dragged).jpeg -------------------------------------------------------------------------------- /Scripts/Giffer/images/source-7 (dragged).jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Giffer/images/source-7 (dragged).jpeg -------------------------------------------------------------------------------- /Scripts/Giffer/images/source-8 (dragged).jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheSwiftAlps/Scripting/967c5583dbbb0d37770537966b8116096701c02e/Scripts/Giffer/images/source-8 (dragged).jpeg --------------------------------------------------------------------------------