| title | updated | layout | category | prism_languages | intro | |
|---|---|---|---|---|---|---|
AppleScript |
2023-04-05 |
2017/sheet |
macOS |
|
AppleScript is a scripting language for automating macOS. |
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
| (() => { | |
| ObjC.import("CoreServices") | |
| const unsummarizedText = `Inventore eveniet eum veritatis inventore necessitatibus provident. Sit reprehenderit non ad. Blanditiis impedit sapiente. Incidunt harum neque commodi rerum nobis dolor aliquam. Ipsam consequatur distinctio ratione veniam hic. Possimus iure molestiae tempore cumque reiciendis repudiandae quibusdam.` | |
| const numOutputSentences = 3 | |
| const CFStringRef = $.CFStringCreateWithCString(null, unsummarizedText, $.kCFStringEncodingMacRoman) | |
| const summaryObj = $.SKSummaryCreateWithString(CFStringRef) | |
| const summaryText = ObjC.castRefToObject($.SKSummaryCopySentenceSummaryString(summaryObj, numOutputSentences)).js | |
| return summaryText |
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
| (() => { | |
| ObjC.import("objc"); | |
| ObjC.import("CoreMedia"); | |
| ObjC.import("Foundation"); | |
| ObjC.import("AVFoundation"); | |
| ObjC.import("CoreGraphics"); | |
| ObjC.import("CoreImage"); | |
| ObjC.import("AppKit"); | |
| const outputPath = "/Users/example/Downloads/example.tiff" |
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
| (() => { | |
| ObjC.import("objc"); | |
| ObjC.import("CoreMedia"); | |
| ObjC.import("Foundation"); | |
| ObjC.import("AVFoundation"); | |
| ObjC.import("Vision"); | |
| ObjC.import("AppKit"); | |
| // Load the video file | |
| const assetURL = $.NSURL.fileURLWithPath( |
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
| (() => { | |
| ObjC.import('CoreLocation') | |
| app = Application.currentApplication() | |
| app.includeStandardAdditions = true | |
| if (!$['CLLocationManagerDelegate']) { | |
| ObjC.registerSubclass({ | |
| name: 'CLLocationManagerDelegate', | |
| superclass: 'NSObject', | |
| protocols: ['CLLocationManagerDelegate'], |
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
| (() => { | |
| ObjC.import('Foundation'); | |
| ObjC.import('Speech'); | |
| var app = Application.currentApplication(); | |
| if (!$['SFSpeechRecognitionTaskDelegate']) { | |
| ObjC.registerSubclass({ | |
| name: 'SFSpeechRecognitionTaskDelegate', | |
| superclass: 'NSObject', |
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
| use framework "Foundation" | |
| (* | |
| Gets a record of information contain in a plist file. | |
| Params: | |
| thePath (String) - Path to the plist file. | |
| Returns: | |
| (Record) - The property:value pairs in the plist. |
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
| import { closeMainWindow } from "@raycast/api" | |
| import { runAppleScript } from "run-applescript" | |
| const displayWindow = async () => { | |
| console.log(await runAppleScript(`use framework "Foundation" | |
| use scripting additions | |
| set theWindow to missing value | |
| -- Can only display windows on the main thread | |
| my performSelectorOnMainThread:"showWindow" withObject:(missing value) waitUntilDone:true |
| Title | Prompt |
|---|---|
| Brainstorm Ideas Based On This | Brainstorm 5 project ideas based on this text: |
| Create Action Items | Generate a markdown list of action items to complete based on the following text, using a unique identifier for each item as bold headings. If there are any errors in the text, make actions items to fix them. In a sublist of each item, provide a description, priority, estimated level of difficulty, and a reasonable duration for the task. Here is the text: |
| Create Flashcards | Create 3 Anki flashcards based on the following text. Format the response as markdown with the bold questions and plaintext answers. Separate each entry with ‘—‘. Here’s the text: |
| Generate Cheatsheet | Generate a concise cheatsheet for the concepts in this text. Add additional details based on your own knowledge of the topic. |
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
| tell application "System Events" | |
| set theProcess to first application process whose name is "ControlCenter" | |
| click menu bar item 2 of menu bar 1 of theProcess | |
| perform action 1 of button 1 of group 1 of window 1 of theProcess | |
| end tell |