├── LICENSE ├── Load Instagram Photos.sketchplugin ├── Logout.sketchplugin ├── README.md ├── _ Feedback.sketchplugin ├── library ├── SketchSquaresPlugin.app │ └── Contents │ │ ├── Frameworks │ │ ├── CocoaScript.framework │ │ │ ├── CocoaScript │ │ │ ├── Resources │ │ │ └── Versions │ │ │ │ ├── A │ │ │ │ ├── CocoaScript │ │ │ │ ├── Resources │ │ │ │ │ └── Info.plist │ │ │ │ └── _CodeSignature │ │ │ │ │ └── CodeResources │ │ │ │ └── Current │ │ ├── libswiftAppKit.dylib │ │ ├── libswiftCore.dylib │ │ ├── libswiftCoreGraphics.dylib │ │ ├── libswiftDarwin.dylib │ │ ├── libswiftDispatch.dylib │ │ ├── libswiftFoundation.dylib │ │ ├── libswiftObjectiveC.dylib │ │ ├── libswiftQuartzCore.dylib │ │ └── libswiftSecurity.dylib │ │ ├── Info.plist │ │ ├── MacOS │ │ └── SketchSquaresPlugin │ │ ├── PkgInfo │ │ ├── Resources │ │ ├── AppIcon.icns │ │ ├── Base.lproj │ │ │ └── Main.storyboardc │ │ │ │ ├── ConfigWindow.nib │ │ │ │ ├── FeedbackWindow.nib │ │ │ │ ├── ILg-HO-Zy9-view-Lbf-i3-j5Z.nib │ │ │ │ ├── Info.plist │ │ │ │ ├── LoginWindow.nib │ │ │ │ ├── LogoutWindow.nib │ │ │ │ ├── MainMenu.nib │ │ │ │ ├── UpdatesWindow.nib │ │ │ │ ├── Uwd-qV-JyJ-view-OTO-15-sOs.nib │ │ │ │ ├── XfG-lQ-9wD-view-m2S-Jp-Qdl.nib │ │ │ │ ├── rwa-II-V8f-view-6fO-Dp-6k0.nib │ │ │ │ └── tEk-0w-mTx-view-6lj-Z1-Cg6.nib │ │ └── archived-expanded-entitlements.xcent │ │ └── _CodeSignature │ │ └── CodeResources ├── communicator.js ├── helpers.js └── icon_256x256.png └── sketchpack.json /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Aby Nimbalkar 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 | 23 | -------------------------------------------------------------------------------- /Load Instagram Photos.sketchplugin: -------------------------------------------------------------------------------- 1 | // Load Instagram Photos (ctrl shift i) 2 | @import 'library/communicator.js' 3 | 4 | function run() { 5 | 6 | if(selectionIsEmpty()) { 7 | showDialog("Select one or more layers to replace with photos from Instagram.") 8 | return 9 | } 10 | 11 | var numLayers = [selection count], 12 | maxSize = 100, 13 | layerFrame; 14 | 15 | var loop = [selection objectEnumerator] 16 | while (layer = [loop nextObject]) { 17 | layerFrame = getRect(layer) 18 | maxSize = Math.max(layerFrame.width, maxSize) 19 | maxSize = Math.max(layerFrame.height, maxSize) 20 | } 21 | 22 | var commands = {numberOfLayers:numLayers, maxSize:maxSize} 23 | sendJSONCommands(commands) 24 | } 25 | 26 | run() 27 | -------------------------------------------------------------------------------- /Logout.sketchplugin: -------------------------------------------------------------------------------- 1 | #import 'library/communicator.js' 2 | var commands = {logout:true} 3 | sendJSONCommands(commands) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SketchSquares 2 | 3 | Replace layers in Sketch with photos from Instagram. 4 | 5 | 6 | ## Demo 7 | 8 | [![Video](https://i.vimeocdn.com/video/501558466.jpg?mw=1920)](https://vimeo.com/115152380) 9 | [Watch on Vimeo](https://vimeo.com/115152380) 10 | 11 | 12 | ## Installation 13 | 14 | Download and unzip the contents of this repository into your plugins folder. If you don't know where your plugins folder is, [follow these steps](http://bohemiancoding.com/sketch/support/developer/01-introduction/01.html) to find it. 15 | 16 | ## Usage 17 | 18 | 1. In Sketch, select the layers that you want to replace with Instagram photos, then run the plugin. 19 | * _Note: First time you use the plugin, you'll be asked to login to Instagram. The plugin will remember you until you log out._ 20 | ![Plugin Window](http://silverux.com/ig-auth/assets/sketchsquares-1a.png) 21 | 2. Once you're logged in, select the source of the photos you want to use. 22 | ![Plugin Window - Sources](http://silverux.com/ig-auth/assets/sketchsquares-3a.png) 23 | 3. You can choose to either replace selected layers with new Bitmap layers, or insert photos as pattern fills (useful for adding images to round shapes). 24 | 4. If you're using Sketch at work, you might want to log out of Instagram when you're done. 25 | ![Logout Menu](http://silverux.com/ig-auth/assets/sketchsquares-4a.png) 26 | 27 | ### Image sizes 28 | 29 | Instagram makes photos available in three sizes. 30 | 31 | SketchSquares Plugin will guess the image size you want to load based on the size of the layers you've selected. You can change this using the size menu. 32 | 33 | ![Plugin Window - Sizes](http://silverux.com/ig-auth/assets/sketchsquares-2a.png) 34 | 35 | ### Shortcut 36 | 37 | Once you've installed the plugin you can trigger it using this shortcut: `control` + `shift` + `i`. You can change this shortcut (if it clashes with other plugins you may be using) by editing the first line of the `Load Instagram Photos.sketchplugin` file. 38 | 39 | ### Updates 40 | 41 | The SketchSquares Plugin will automatically check for updates when you run it, and will let you know when a new version is available for download. It will let you install the updated version directly from the plugin window. 42 | 43 | ![Plugin Window - When an update is available](http://silverux.com/ig-auth/assets/sketchsquares-5a.png) 44 | 45 | 46 | ## Supported Versions 47 | 48 | Sketch 3.2.1 or later on OSX Yosemite. 49 | 50 | ## Bugs, Features and Feedback 51 | 52 | Please use the inbuilt Feedback Menu to report bugs, request new features or just send me general feedback. Bugs and feature requests sent via the Feedback form will get logged as Issues here on GitHub to make them easier to track. 53 | 54 | ![Feedback Menu](http://silverux.com/ig-auth/assets/sketchsquares-6a.png) 55 | 56 | You can also send me feedback via Twitter [@abynim](http://twitter.com/abynim). 57 | 58 | ## Inspiration and Credits 59 | 60 | The inspiration for the SketchSquares Plugin came from a post by [@iansilber](https://twitter.com/iansilber) called [Design Tools at Instagram](https://medium.com/@iansilber/design-tools-at-instagram-4f5867afa4f4). 61 | 62 | Making this plugin was possible only through all the tricks I've learned from the awesome [Sketch](http://www.bohemiancoding.com/sketch/) community. Thanks everyone! 63 | 64 | --- 65 | 66 | MIT License © Aby Nimbalkar. I'm on [LinkedIn](http://tw.linkedin.com/in/abynim/), [Twitter](http://twitter.com/abynim) and obviously [Instagram](http://instagram.com/abynim). 67 | -------------------------------------------------------------------------------- /_ Feedback.sketchplugin: -------------------------------------------------------------------------------- 1 | @import 'library/communicator.js' 2 | var commands = {sendFeedback:true} 3 | sendJSONCommands(commands) -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Frameworks/CocoaScript.framework/CocoaScript: -------------------------------------------------------------------------------- 1 | Versions/Current/CocoaScript -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Frameworks/CocoaScript.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Frameworks/CocoaScript.framework/Versions/A/CocoaScript: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Frameworks/CocoaScript.framework/Versions/A/CocoaScript -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Frameworks/CocoaScript.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 13E28 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | CocoaScript 11 | CFBundleIdentifier 12 | com.cocoascript.CocoaScript 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.0 21 | DTCompiler 22 | com.apple.compilers.llvm.clang.1_0 23 | DTPlatformBuild 24 | 5B45j 25 | DTPlatformVersion 26 | GM 27 | DTSDKBuild 28 | 13A595 29 | DTSDKName 30 | macosx10.9 31 | DTXcode 32 | 0510 33 | DTXcodeBuild 34 | 5B45j 35 | 36 | 37 | -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Frameworks/CocoaScript.framework/Versions/A/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | KmBVYxi8MkQSpvdzxPVHp+Zo9bE= 10 | 11 | 12 | files2 13 | 14 | Resources/Info.plist 15 | 16 | KmBVYxi8MkQSpvdzxPVHp+Zo9bE= 17 | 18 | 19 | rules 20 | 21 | ^Resources/ 22 | 23 | ^Resources/.*\.lproj/ 24 | 25 | optional 26 | 27 | weight 28 | 1000 29 | 30 | ^Resources/.*\.lproj/locversion.plist$ 31 | 32 | omit 33 | 34 | weight 35 | 1100 36 | 37 | ^version.plist$ 38 | 39 | 40 | rules2 41 | 42 | .*\.dSYM($|/) 43 | 44 | weight 45 | 11 46 | 47 | ^(.*/)?\.DS_Store$ 48 | 49 | omit 50 | 51 | weight 52 | 2000 53 | 54 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 55 | 56 | nested 57 | 58 | weight 59 | 10 60 | 61 | ^.* 62 | 63 | ^Info\.plist$ 64 | 65 | omit 66 | 67 | weight 68 | 20 69 | 70 | ^PkgInfo$ 71 | 72 | omit 73 | 74 | weight 75 | 20 76 | 77 | ^Resources/ 78 | 79 | weight 80 | 20 81 | 82 | ^Resources/.*\.lproj/ 83 | 84 | optional 85 | 86 | weight 87 | 1000 88 | 89 | ^Resources/.*\.lproj/locversion.plist$ 90 | 91 | omit 92 | 93 | weight 94 | 1100 95 | 96 | ^[^/]+$ 97 | 98 | nested 99 | 100 | weight 101 | 10 102 | 103 | ^embedded\.provisionprofile$ 104 | 105 | weight 106 | 20 107 | 108 | ^version\.plist$ 109 | 110 | weight 111 | 20 112 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Frameworks/CocoaScript.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Frameworks/libswiftAppKit.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Frameworks/libswiftAppKit.dylib -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Frameworks/libswiftCore.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Frameworks/libswiftCore.dylib -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Frameworks/libswiftCoreGraphics.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Frameworks/libswiftCoreGraphics.dylib -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Frameworks/libswiftDarwin.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Frameworks/libswiftDarwin.dylib -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Frameworks/libswiftDispatch.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Frameworks/libswiftDispatch.dylib -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Frameworks/libswiftFoundation.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Frameworks/libswiftFoundation.dylib -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Frameworks/libswiftObjectiveC.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Frameworks/libswiftObjectiveC.dylib -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Frameworks/libswiftQuartzCore.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Frameworks/libswiftQuartzCore.dylib -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Frameworks/libswiftSecurity.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Frameworks/libswiftSecurity.dylib -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 14B25 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleDocumentTypes 10 | 11 | 12 | CFBundleTypeExtensions 13 | 14 | ssplugin 15 | 16 | CFBundleTypeIconFile 17 | application.icns 18 | CFBundleTypeMIMETypes 19 | 20 | application/json 21 | 22 | CFBundleTypeName 23 | SketchSquares Plugin Launcher 24 | CFBundleTypeRole 25 | Viewer 26 | LSIsAppleDefaultForType 27 | 28 | 29 | 30 | CFBundleExecutable 31 | SketchSquaresPlugin 32 | CFBundleIconFile 33 | AppIcon 34 | CFBundleIdentifier 35 | com.silverux.plugins.sketchsquares 36 | CFBundleInfoDictionaryVersion 37 | 6.0 38 | CFBundleName 39 | SketchSquaresPlugin 40 | CFBundlePackageType 41 | APPL 42 | CFBundleShortVersionString 43 | 1.0 44 | CFBundleSignature 45 | ???? 46 | CFBundleVersion 47 | 4 48 | DTCompiler 49 | com.apple.compilers.llvm.clang.1_0 50 | DTPlatformBuild 51 | 6A2008a 52 | DTPlatformVersion 53 | GM 54 | DTSDKBuild 55 | 14A382 56 | DTSDKName 57 | macosx10.10 58 | DTXcode 59 | 0611 60 | DTXcodeBuild 61 | 6A2008a 62 | LSMinimumSystemVersion 63 | 10.9 64 | LSUIElement 65 | 66 | NSHumanReadableCopyright 67 | Copyright © 2014 Aby Nimbalkar. All rights reserved. 68 | NSMainStoryboardFile 69 | Main 70 | NSPrincipalClass 71 | NSApplication 72 | 73 | 74 | -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/MacOS/SketchSquaresPlugin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/MacOS/SketchSquaresPlugin -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/PkgInfo: -------------------------------------------------------------------------------- 1 | APPL???? -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Resources/AppIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Resources/AppIcon.icns -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/ConfigWindow.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/ConfigWindow.nib -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/FeedbackWindow.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/FeedbackWindow.nib -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/ILg-HO-Zy9-view-Lbf-i3-j5Z.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/ILg-HO-Zy9-view-Lbf-i3-j5Z.nib -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/Info.plist -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/LoginWindow.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/LoginWindow.nib -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/LogoutWindow.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/LogoutWindow.nib -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/MainMenu.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/MainMenu.nib -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/UpdatesWindow.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/UpdatesWindow.nib -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/Uwd-qV-JyJ-view-OTO-15-sOs.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/Uwd-qV-JyJ-view-OTO-15-sOs.nib -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/rwa-II-V8f-view-6fO-Dp-6k0.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/rwa-II-V8f-view-6fO-Dp-6k0.nib -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/tEk-0w-mTx-view-6lj-Z1-Cg6.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/SketchSquaresPlugin.app/Contents/Resources/Base.lproj/Main.storyboardc/tEk-0w-mTx-view-6lj-Z1-Cg6.nib -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/Resources/archived-expanded-entitlements.xcent: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.application-identifier 6 | S2UM97N3N3.com.silverux.plugins.sketchsquares 7 | 8 | 9 | -------------------------------------------------------------------------------- /library/SketchSquaresPlugin.app/Contents/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/AppIcon.icns 8 | 9 | OcymOxqW2gmCyFQOBA67ItiJj6g= 10 | 11 | Resources/Base.lproj/Main.storyboardc/ConfigWindow.nib 12 | 13 | hash 14 | 15 | xe202JClkjHqX7JuQ5GS+CuTtlQ= 16 | 17 | optional 18 | 19 | 20 | Resources/Base.lproj/Main.storyboardc/FeedbackWindow.nib 21 | 22 | hash 23 | 24 | SLaWE3yE2JoX3iqawR6gtA0eGHo= 25 | 26 | optional 27 | 28 | 29 | Resources/Base.lproj/Main.storyboardc/ILg-HO-Zy9-view-Lbf-i3-j5Z.nib 30 | 31 | hash 32 | 33 | GGjQZUg0IJ9nxBvBxPIZ4xfz49U= 34 | 35 | optional 36 | 37 | 38 | Resources/Base.lproj/Main.storyboardc/Info.plist 39 | 40 | hash 41 | 42 | YGOM4L+rDv59UJf7v4wP+BsYUZQ= 43 | 44 | optional 45 | 46 | 47 | Resources/Base.lproj/Main.storyboardc/LoginWindow.nib 48 | 49 | hash 50 | 51 | 2A+Q5Qaix6GFw1UmyC4mPyWFjwc= 52 | 53 | optional 54 | 55 | 56 | Resources/Base.lproj/Main.storyboardc/LogoutWindow.nib 57 | 58 | hash 59 | 60 | FhasOCwkALxpeQjX8H6R7gp98Lw= 61 | 62 | optional 63 | 64 | 65 | Resources/Base.lproj/Main.storyboardc/MainMenu.nib 66 | 67 | hash 68 | 69 | jR589H0mmWOJavKFcDEbCLdMSGo= 70 | 71 | optional 72 | 73 | 74 | Resources/Base.lproj/Main.storyboardc/UpdatesWindow.nib 75 | 76 | hash 77 | 78 | YTviRo1Qt72OYksXCu8mTXj3yew= 79 | 80 | optional 81 | 82 | 83 | Resources/Base.lproj/Main.storyboardc/Uwd-qV-JyJ-view-OTO-15-sOs.nib 84 | 85 | hash 86 | 87 | 4HYczpY3JRY4HezmnotJ2lthdOc= 88 | 89 | optional 90 | 91 | 92 | Resources/Base.lproj/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib 93 | 94 | hash 95 | 96 | xYJlFTQ7ySmgPY9/9M+StinBq5E= 97 | 98 | optional 99 | 100 | 101 | Resources/Base.lproj/Main.storyboardc/rwa-II-V8f-view-6fO-Dp-6k0.nib 102 | 103 | hash 104 | 105 | 5hIXJ7XUsolhu2uRs72E7gJox6c= 106 | 107 | optional 108 | 109 | 110 | Resources/Base.lproj/Main.storyboardc/tEk-0w-mTx-view-6lj-Z1-Cg6.nib 111 | 112 | hash 113 | 114 | /nXHxohvnbcCErvr88+7gfPBmwE= 115 | 116 | optional 117 | 118 | 119 | Resources/archived-expanded-entitlements.xcent 120 | 121 | 1oWk7+nwRSFkklK5Pe5NyFPMuCQ= 122 | 123 | 124 | files2 125 | 126 | Frameworks/CocoaScript.framework 127 | 128 | cdhash 129 | 130 | U0zD5ERCvrffoHcch14PeSFRess= 131 | 132 | requirement 133 | anchor apple generic and identifier "com.cocoascript.CocoaScript" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = S2UM97N3N3) 134 | 135 | Frameworks/libswiftAppKit.dylib 136 | 137 | cdhash 138 | 139 | patZwxTnTGCJRIlzG7IT7TaAtXw= 140 | 141 | requirement 142 | anchor apple generic and identifier "com.apple.dt.runtime.swiftAppKit" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = S2UM97N3N3) 143 | 144 | Frameworks/libswiftCore.dylib 145 | 146 | cdhash 147 | 148 | Sj/07HP1pRV0F9fD9plpYA3vGoE= 149 | 150 | requirement 151 | anchor apple generic and identifier "com.apple.dt.runtime.swiftCore" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = S2UM97N3N3) 152 | 153 | Frameworks/libswiftCoreGraphics.dylib 154 | 155 | cdhash 156 | 157 | WMPBpYhxOy9mpLgneE3x2FvK7hE= 158 | 159 | requirement 160 | anchor apple generic and identifier "com.apple.dt.runtime.swiftCoreGraphics" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = S2UM97N3N3) 161 | 162 | Frameworks/libswiftDarwin.dylib 163 | 164 | cdhash 165 | 166 | Ltv9wLxm0E1wufLqjBFEEhKKlug= 167 | 168 | requirement 169 | anchor apple generic and identifier "com.apple.dt.runtime.swiftDarwin" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = S2UM97N3N3) 170 | 171 | Frameworks/libswiftDispatch.dylib 172 | 173 | cdhash 174 | 175 | 0x4Md9fPELvYCAtGuEWn2q0U0LQ= 176 | 177 | requirement 178 | anchor apple generic and identifier "com.apple.dt.runtime.swiftDispatch" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = S2UM97N3N3) 179 | 180 | Frameworks/libswiftFoundation.dylib 181 | 182 | cdhash 183 | 184 | nPKcEvWBQ8LNC39MylUWTfovd3M= 185 | 186 | requirement 187 | anchor apple generic and identifier "com.apple.dt.runtime.swiftFoundation" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = S2UM97N3N3) 188 | 189 | Frameworks/libswiftObjectiveC.dylib 190 | 191 | cdhash 192 | 193 | 5baYv0pQYAvM7V4owC6PhusBJ7Q= 194 | 195 | requirement 196 | anchor apple generic and identifier "com.apple.dt.runtime.swiftObjectiveC" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = S2UM97N3N3) 197 | 198 | Frameworks/libswiftQuartzCore.dylib 199 | 200 | cdhash 201 | 202 | 3qGQE9LN+ubwbh0NQrDDB0JuRho= 203 | 204 | requirement 205 | anchor apple generic and identifier "com.apple.dt.runtime.swiftQuartzCore" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = S2UM97N3N3) 206 | 207 | Frameworks/libswiftSecurity.dylib 208 | 209 | cdhash 210 | 211 | SNnYnv2+fFR6ps2rT6L7r/g1Ntc= 212 | 213 | requirement 214 | anchor apple generic and identifier "com.apple.dt.runtime.swiftSecurity" and (certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = S2UM97N3N3) 215 | 216 | Resources/AppIcon.icns 217 | 218 | OcymOxqW2gmCyFQOBA67ItiJj6g= 219 | 220 | Resources/Base.lproj/Main.storyboardc/ConfigWindow.nib 221 | 222 | hash 223 | 224 | xe202JClkjHqX7JuQ5GS+CuTtlQ= 225 | 226 | optional 227 | 228 | 229 | Resources/Base.lproj/Main.storyboardc/FeedbackWindow.nib 230 | 231 | hash 232 | 233 | SLaWE3yE2JoX3iqawR6gtA0eGHo= 234 | 235 | optional 236 | 237 | 238 | Resources/Base.lproj/Main.storyboardc/ILg-HO-Zy9-view-Lbf-i3-j5Z.nib 239 | 240 | hash 241 | 242 | GGjQZUg0IJ9nxBvBxPIZ4xfz49U= 243 | 244 | optional 245 | 246 | 247 | Resources/Base.lproj/Main.storyboardc/Info.plist 248 | 249 | hash 250 | 251 | YGOM4L+rDv59UJf7v4wP+BsYUZQ= 252 | 253 | optional 254 | 255 | 256 | Resources/Base.lproj/Main.storyboardc/LoginWindow.nib 257 | 258 | hash 259 | 260 | 2A+Q5Qaix6GFw1UmyC4mPyWFjwc= 261 | 262 | optional 263 | 264 | 265 | Resources/Base.lproj/Main.storyboardc/LogoutWindow.nib 266 | 267 | hash 268 | 269 | FhasOCwkALxpeQjX8H6R7gp98Lw= 270 | 271 | optional 272 | 273 | 274 | Resources/Base.lproj/Main.storyboardc/MainMenu.nib 275 | 276 | hash 277 | 278 | jR589H0mmWOJavKFcDEbCLdMSGo= 279 | 280 | optional 281 | 282 | 283 | Resources/Base.lproj/Main.storyboardc/UpdatesWindow.nib 284 | 285 | hash 286 | 287 | YTviRo1Qt72OYksXCu8mTXj3yew= 288 | 289 | optional 290 | 291 | 292 | Resources/Base.lproj/Main.storyboardc/Uwd-qV-JyJ-view-OTO-15-sOs.nib 293 | 294 | hash 295 | 296 | 4HYczpY3JRY4HezmnotJ2lthdOc= 297 | 298 | optional 299 | 300 | 301 | Resources/Base.lproj/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib 302 | 303 | hash 304 | 305 | xYJlFTQ7ySmgPY9/9M+StinBq5E= 306 | 307 | optional 308 | 309 | 310 | Resources/Base.lproj/Main.storyboardc/rwa-II-V8f-view-6fO-Dp-6k0.nib 311 | 312 | hash 313 | 314 | 5hIXJ7XUsolhu2uRs72E7gJox6c= 315 | 316 | optional 317 | 318 | 319 | Resources/Base.lproj/Main.storyboardc/tEk-0w-mTx-view-6lj-Z1-Cg6.nib 320 | 321 | hash 322 | 323 | /nXHxohvnbcCErvr88+7gfPBmwE= 324 | 325 | optional 326 | 327 | 328 | Resources/archived-expanded-entitlements.xcent 329 | 330 | 1oWk7+nwRSFkklK5Pe5NyFPMuCQ= 331 | 332 | 333 | rules 334 | 335 | ^Resources/ 336 | 337 | ^Resources/.*\.lproj/ 338 | 339 | optional 340 | 341 | weight 342 | 1000 343 | 344 | ^Resources/.*\.lproj/locversion.plist$ 345 | 346 | omit 347 | 348 | weight 349 | 1100 350 | 351 | ^version.plist$ 352 | 353 | 354 | rules2 355 | 356 | .*\.dSYM($|/) 357 | 358 | weight 359 | 11 360 | 361 | ^(.*/)?\.DS_Store$ 362 | 363 | omit 364 | 365 | weight 366 | 2000 367 | 368 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 369 | 370 | nested 371 | 372 | weight 373 | 10 374 | 375 | ^.* 376 | 377 | ^Info\.plist$ 378 | 379 | omit 380 | 381 | weight 382 | 20 383 | 384 | ^PkgInfo$ 385 | 386 | omit 387 | 388 | weight 389 | 20 390 | 391 | ^Resources/ 392 | 393 | weight 394 | 20 395 | 396 | ^Resources/.*\.lproj/ 397 | 398 | optional 399 | 400 | weight 401 | 1000 402 | 403 | ^Resources/.*\.lproj/locversion.plist$ 404 | 405 | omit 406 | 407 | weight 408 | 1100 409 | 410 | ^[^/]+$ 411 | 412 | nested 413 | 414 | weight 415 | 10 416 | 417 | ^embedded\.provisionprofile$ 418 | 419 | weight 420 | 20 421 | 422 | ^version\.plist$ 423 | 424 | weight 425 | 20 426 | 427 | 428 | 429 | 430 | -------------------------------------------------------------------------------- /library/communicator.js: -------------------------------------------------------------------------------- 1 | @import 'library/helpers.js' 2 | 3 | var kPluginName = "SketchSquares Plugin", 4 | kPluginDomain = "com.silverux.instagram-sketch-plugin" 5 | 6 | function sendJSONCommands(params) { 7 | 8 | var sp = sketch.scriptPath, 9 | folder = [sp stringByDeletingLastPathComponent], 10 | appPath = folder + "/library/SketchSquaresPlugin.app", 11 | uniqueID = [[NSUUID UUID] UUIDString], 12 | tempFolderPath = getTempFolderPath("temp-commands/"+uniqueID), 13 | jsonPath = tempFolderPath + "/c.ssplugin", 14 | bundlePath = [[NSBundle mainBundle] bundlePath], 15 | appName = [[NSFileManager defaultManager] displayNameAtPath: bundlePath], 16 | d = [NSMutableDictionary new], 17 | val; 18 | 19 | for (var key in params) { 20 | val = params[key] 21 | [d setValue:val forKey:key] 22 | } 23 | [d setValue:kPluginDomain forKey:"pluginDomain"] 24 | [d setValue:sp forKey:"scriptPath"] 25 | [d setValue:folder forKey:"scriptFolder"] 26 | [d setValue:appName forKey:"appName"] 27 | 28 | var jData = [NSJSONSerialization dataWithJSONObject:d options:0 error:nil], 29 | jsonString = [[NSString alloc] initWithData:jData encoding:NSUTF8StringEncoding] 30 | 31 | createFolderForPath(tempFolderPath) 32 | writeTextToFile(jsonString, jsonPath) 33 | 34 | if(![[NSWorkspace sharedWorkspace] openFile:jsonPath withApplication:appPath]]) { 35 | showDialog("Could not launch plugin") 36 | } 37 | } 38 | 39 | function populateImages(images, replaceLayers) { 40 | if(selectionIsEmpty()) { 41 | showDialog("Nothing selected") 42 | return 43 | } 44 | 45 | var i = 0, 46 | targetFrame, bmpLayer, layerName, imagePath; 47 | 48 | var loop = [selection objectEnumerator] 49 | while (layer = [loop nextObject]) { 50 | 51 | if (i < images.length) { 52 | 53 | if (replaceLayers == true) { 54 | imagePath = [NSString stringWithFormat:@"%@", images[i]] 55 | layerName = imagePath.lastPathComponent().split("__")[0] 56 | targetFrame = getRect(layer) 57 | bmpLayer = addBitmap(imagePath, [layer parentGroup], "@"+layerName) 58 | setPosition(bmpLayer, targetFrame.x, targetFrame.y, true) 59 | setSize(bmpLayer, targetFrame.width, targetFrame.height) 60 | [bmpLayer select:true byExpandingSelection:(i!=0)] 61 | removeLayer(layer) 62 | } else { 63 | setBitmapFill(layer, images[i]) 64 | [layer select:true byExpandingSelection:(i!=0)] 65 | } 66 | 67 | i++ 68 | 69 | } else { 70 | break; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /library/helpers.js: -------------------------------------------------------------------------------- 1 | var currentPage = [doc currentPage], 2 | currentArtboard = [[doc currentPage] currentArtboard], 3 | stage = currentArtboard ? currentArtboard : currentPage, 4 | iconName = "icon_256x256.png", 5 | SKVersion3_3 = "3.3", 6 | SKVersion3_4 = "3.4", 7 | sketchVersion = getMajorVersion(); 8 | 9 | function showDialog (message, OKHandler) { 10 | var alert = [COSAlertWindow new]; 11 | [alert setMessageText: kPluginName] 12 | [alert setInformativeText: message] 13 | var scriptPath = sketch.scriptPath, 14 | folder = [scriptPath stringByDeletingLastPathComponent], 15 | iconPath = folder + "/library/" + iconName, 16 | icon = [[NSImage alloc] initByReferencingFile:iconPath] 17 | [alert setIcon:icon] 18 | var responseCode = [alert runModal]; 19 | if(OKHandler != nil && responseCode == 0) OKHandler() 20 | } 21 | 22 | function selectionIsEmpty() { 23 | return ([selection count] == 0) 24 | } 25 | 26 | function getTempFolderPath(withName) { 27 | var fileManager = [NSFileManager defaultManager]; 28 | var cachesURL = [[fileManager URLsForDirectory:NSCachesDirectory inDomains:NSUserDomainMask] lastObject]; 29 | if(typeof withName !== 'undefined') return [[cachesURL URLByAppendingPathComponent:kPluginDomain] path] + "/" + withName; 30 | return [[cachesURL URLByAppendingPathComponent:kPluginDomain] path] + "/" + [[NSDate date] timeIntervalSince1970]; 31 | } 32 | 33 | function createFolderForPath(pathString) { 34 | var fileManager = [NSFileManager defaultManager]; 35 | if([fileManager fileExistsAtPath:pathString]) return true; 36 | return [fileManager createDirectoryAtPath:pathString withIntermediateDirectories:true attributes:nil error:nil] 37 | } 38 | 39 | function writeTextToFile(text, filePath) { 40 | var t = [NSString stringWithFormat:@"%@", text], 41 | f = [NSString stringWithFormat:@"%@", filePath]; 42 | return [t writeToFile:f atomically:true encoding:NSUTF8StringEncoding error:nil]; 43 | } 44 | 45 | function getRect(layer) { 46 | var rect = [layer absoluteRect]; 47 | return { 48 | x: Math.round([rect x]), 49 | y: Math.round([rect y]), 50 | width: Math.round([rect width]), 51 | height: Math.round([rect height]) 52 | }; 53 | } 54 | 55 | function removeLayer(layer) { 56 | var parent = [layer parentGroup]; 57 | if (parent)[parent removeLayer: layer]; 58 | } 59 | 60 | function setSize(layer, width, height, absolute) { 61 | if(absolute){ 62 | [[layer absoluteRect] setWidth: width]; 63 | [[layer absoluteRect] setHeight: height]; 64 | } 65 | else{ 66 | [[layer frame] setWidth: width]; 67 | [[layer frame] setHeight: height]; 68 | } 69 | 70 | return layer; 71 | } 72 | 73 | function setPosition(layer, x, y, absolute) { 74 | if(absolute){ 75 | [[layer absoluteRect] setX: x]; 76 | [[layer absoluteRect] setY: y]; 77 | } 78 | else{ 79 | [[layer frame] setX: x]; 80 | [[layer frame] setY: y]; 81 | } 82 | 83 | return layer; 84 | } 85 | 86 | 87 | function addBitmap(filePath, parent, name) { 88 | 89 | if (sketchVersion == SKVersion3_4) { 90 | var parent = parent ? parent : stage; 91 | if(![parent documentData]) { 92 | showDialog("Before adding a Bitmap, add its parent to the document.") 93 | return 94 | } 95 | 96 | var layer = [MSBitmapLayer bitmapLayerWithImageFromPath:filePath] 97 | if(!name) name = "Bitmap" 98 | [layer setName:name] 99 | [parent addLayers:[layer]] 100 | 101 | return layer 102 | 103 | } 104 | else { 105 | var parent = parent ? parent : stage, 106 | layer = [MSBitmapLayer bitmapLayerWithImageFromPath:filePath]; 107 | 108 | if(![parent documentData]) { 109 | showDialog("Before adding a Bitmap, add its parent to the document.") 110 | return 111 | } 112 | 113 | if(!name) name = "Bitmap" 114 | [layer setName:name] 115 | [parent addLayers:[layer]] 116 | 117 | var data = [NSData dataWithContentsOfFile:filePath] 118 | var image = [[MSImageData alloc] initWithData:data sha:nil] 119 | 120 | if(image) { 121 | 122 | var fills = [[layer style] fills]; 123 | [layer setConstrainProportions:false] 124 | [fills addNewStylePart] 125 | [[fills firstObject] setIsEnabled:false] 126 | [[layer frame] setWidth:[[image image] size].width] 127 | [[layer frame] setHeight:[[image image] size].height] 128 | [layer setConstrainProportions:true] 129 | } else { 130 | showDialog("Image file could not be found!") 131 | } 132 | return layer; 133 | } 134 | 135 | } 136 | 137 | function setBitmapFill(layer, imagePath) { 138 | var data = [NSData dataWithContentsOfFile:imagePath] 139 | var image = [[MSImageData alloc] initWithData:data sha:nil] 140 | 141 | if(image) { 142 | 143 | if( [layer class] == MSShapeGroup ) { 144 | 145 | var fills = [[layer style] fills]; 146 | // disable existing fills 147 | var loop = [[fills array] objectEnumerator] 148 | while (existingFill = [loop nextObject]) { 149 | [existingFill setIsEnabled:false] 150 | } 151 | 152 | [fills addNewStylePart]; 153 | 154 | var bmpFill = [fills lastObject], 155 | fillCollection = [[bmpFill documentData] images] 156 | 157 | [bmpFill setFillType:4] 158 | [bmpFill setImage:image] 159 | [bmpFill setPatternFillType:1] 160 | } 161 | } 162 | } 163 | 164 | function getJSONFromURL(url) { 165 | var request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]], 166 | response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil], 167 | responseObj = [NSJSONSerialization JSONObjectWithData:response options:nil error:nil] 168 | return responseObj 169 | } 170 | 171 | function getMajorVersion() { 172 | const version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"] 173 | return (version+"").substr(0, 3) 174 | } 175 | -------------------------------------------------------------------------------- /library/icon_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abynim/SketchSquares/0014615d2400b50da8255e40e90fd6330e2f9207/library/icon_256x256.png -------------------------------------------------------------------------------- /sketchpack.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SketchSquares", 3 | "description": "Replace layers in Sketch with photos from Instagram.", 4 | "tags": ["instagram", "placeholders", "images"] 5 | } --------------------------------------------------------------------------------