This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Variables used by Scriptable. | |
| // These must be at the very top of the file. Do not edit. | |
| // always-run-in-app: true; icon-color: red; | |
| // icon-glyph: film; share-sheet-inputs: url, plain-text; | |
| // Manages a watchlist of movies. Run the script from the share sheet in the IMDb app to add a movie to the watchlist. | |
| // When a movie is added, you can press the "✅"-button to mark the movie as watched. Press the "👀"-button to mark the button to be watched. | |
| // The watchlist is backed by a JSON file stored in iCloud Drive. | |
| let txts = args.plainTexts | |
| let urls = args.urls | |
| // If a plain text and URL input, we're adding a mocke to the list. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Variables used by Scriptable. | |
| // These must be at the very top of the file. Do not edit. | |
| // icon-color: yellow; icon-glyph: bicycle; | |
| let results = await loadResults() | |
| if (config.runsInWidget) { | |
| if (config.widgetFamily == "large") { | |
| let widget = createWidget(results, 8) | |
| await widget.presentLarge() | |
| } else if (config.widgetFamily == "medium") { | |
| let widget = createWidget(results, 3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Variables used by Scriptable. | |
| // These must be at the very top of the file. Do not edit. | |
| // icon-color: cyan; icon-glyph: apple-alt; | |
| const TITLE = "WWDC22" | |
| const PAST_EVENT_TEXT = "Have a great Dub Dub!" | |
| const DATE = "2022-06-06T17:00:00Z" | |
| const BG_IMG_URL = "https://i.ibb.co/9t9CbxX/wwdc22.png" | |
| const LINK = "https://developer.apple.com/wwdc22/" | |
| let widget = await createWidget() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * This file shows how we can tie all of the above together. | |
| */ | |
| import SwiftUI | |
| // This view can have any orientation- | |
| struct SettingsView: View { | |
| @State private var isPortraitOnlyViewPresented = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Variables used by Scriptable. | |
| // These must be at the very top of the file. Do not edit. | |
| // icon-color: brown; icon-glyph: hand-holding-usd; | |
| // To use this script, you must create a personal access token on GitHub with the `read:org// scope. | |
| // Follow the instructions on the link below to create your personal access token. | |
| // | |
| // https://github.com/settings/tokens | |
| // | |
| // Run the script when you ahve created your personal access token. It'll prompt you to enter the token and store it securely in the keychain on the device. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Sample code made in response to this tweet: | |
| // https://twitter.com/stroughtonsmith/status/1485719749673820163 | |
| final class MainView: UIView { | |
| private let textView: UITextView = { | |
| let this = UITextView() | |
| this.translatesAutoresizingMaskIntoConstraints = false | |
| this.text = "I'm a text view" | |
| this.font = .preferredFont(forTextStyle: .body) | |
| this.textColor = .label |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Variables used by Scriptable. | |
| // These must be at the very top of the file. Do not edit. | |
| // icon-color: blue; icon-glyph: apple-alt; | |
| const TITLE = "" | |
| const DATE = "2021-10-18T17:00:00Z" | |
| const BG_IMG_URL = "https://i.ibb.co/YQ09XTW/background.png" | |
| const TITLE_IMG_URL = "https://i.ibb.co/qYH3Y9w/text.png" | |
| const TITLE_IMG_SIZE = new Size(155, 25) | |
| const LINK = "https://www.youtube.com/watch?v=exM1uajp--A" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final class ToolbarController, NSObject, NSToolbarDelegate { | |
| var isBackButtonEnabled = false { | |
| didSet { | |
| if isBackButtonEnabled != oldValue { | |
| reloadBackItem() | |
| } | |
| } | |
| } | |
| func toolbar(_ toolbar: NSToolbar, itemForItemIdentifier itemIdentifier: NSToolbarItem.Identifier, willBeInsertedIntoToolbar flag: Bool) -> NSToolbarItem? { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Variables used by Scriptable. | |
| // These must be at the very top of the file. Do not edit. | |
| // icon-color: yellow; icon-glyph: bicycle; | |
| let stages = await loadStages() | |
| let stage = findStage(stages) | |
| if (stage == null) { | |
| let widget = createTournamentOverWidget() | |
| await widget.presentMedium() | |
| } else { | |
| let stageDetails = await loadStageDetails(stage.id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Variables used by Scriptable. | |
| // These must be at the very top of the file. Do not edit. | |
| // icon-color: deep-green; icon-glyph: tree; | |
| const STATION_VIBORG = "49" | |
| const STATION_CPH = "48" | |
| const IDS = { | |
| BIRCH: "7", | |
| MUGWORT: "31", | |
| ALDER: "1", | |
| ELM: "4", |