Checklist:
- ✅ WIFI
- ✅ Ethernet
- ✅ Display
- ✅ Touchpad
- ✅ USB (2 & 3)
- ❓ HDMI (Video works, haven't bothered to fix audio yet)
- ✅ Sleep
- ✅ Audio (No microphone)
| function run(){ | |
| var shouldRun = confirm("Are you sure you want to accept all suggestions?\n\n(Note: Depending on the number of suggestions you have, this script may take a few seconds to run.)"); | |
| if(!shouldRun) return false; | |
| var events = [ "mouseover", "mousedown", "click", "mouseup" ]; | |
| var suggestionButtons = Array.from(document.querySelectorAll("[role='button'][aria-label='Accept suggestion']")); | |
| suggestionButtons.forEach((el) => { | |
| events.forEach((eventName, i) => { |
| @import JavaScriptCore; | |
| /// Retaining MOJavaScriptObject retains your JSContext/JSObject as well | |
| @interface MOJavaScriptObject : NSObject | |
| @property (readonly) JSObjectRef JSObject; | |
| @property (readonly) JSContextRef JSContext; |
| struct Traits: OptionSet { | |
| var rawValue: Int = 0 | |
| init(rawValue: Int) { | |
| self.rawValue = rawValue | |
| } | |
| } |
Checklist:
| framework("CoreText"); | |
| const document = require("sketch").getSelectedDocument(); | |
| const textLayer = document.selectedLayers.layers[0]; | |
| // WORKS (System font has native support for small caps): | |
| const font = NSFont.systemFontOfSize_weight(28, NSFontWeightBold); |
| // | |
| // UnitBezier.swift | |
| // | |
| // Created by Matt Curtis on 12/24/18. | |
| // Copyright © 2018 Matt Curtis. All rights reserved. | |
| // | |
| import Foundation | |
| // Almost exact translation of WebKit's UnitBezier struct: |
| class DelegateForwarder<T: NSObjectProtocol>: NSObject { | |
| // MARK: - Properties | |
| weak var internalDelegate: T? | |
| weak var externalDelegate: T? | |
| var asConforming: T { |
| framework("CoreText"); | |
| const DOM = require("sketch/dom"); | |
| const textLayer = DOM.getSelectedDocument().pages[0].selectedLayers.layers[0]; | |
| const textView = textLayer.sketchObject.editingDelegate().textView(); | |
| // [NSTextView selectedRanges] returns an NSArray of NSValues: | |
| const selectedRange = textView.selectedRanges()[0].rangeValue(); |
| let sketch = require('sketch') | |
| let settingsAttribute = getSettingsAttributeForKey_Value(kLowerCaseType, kLowerCaseSmallCapsSelector) | |
| applySubstringFontModification() | |
| //getFontAttributesForSelectedRange() | |
| function applySubstringFontModification() { | |
| let document = sketch.getSelectedDocument() | |
| let textLayer = document.selectedLayers.layers[0] |
| import Foundation | |
| import Cocoa | |
| private enum Constants { | |
| static let crlf: Character = "\r\n" | |
| } | |
| /* |