### Hello, Cherri! Example Source: https://github.com/electrikmilk/cherrilang.org/blob/main/index.md A basic 'Hello, World!' example in CherriLang, demonstrating defines and alerts. ```ruby /* Hello, Cherri! */ #define glyph smileyFace #define color yellow @message = "Hello!" alert("Message: {@message}", "Alert") ``` -------------------------------- ### Take Video Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/media.md Prompts the user to start recording a video with specified camera, quality, and start behavior. Camera options are Front and Back. Quality options are Low, Medium, and High. Start options are On Tap and Immediately. Defaults to Front camera, High quality, and Immediately start. Requires an include statement for 'actions/media'. ```action enum cameraOrientation { 'Front', 'Back', } enum videoQuality { 'Low', 'Medium', 'High', } enum recordingStart { 'On Tap', 'Immediately', } takeVideo(cameraOrientation ?camera = "Front", videoQuality ?quality = "High", recordingStart ?recordingStart = "Immediately") ``` -------------------------------- ### Example Reference Declarations Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/references.md These are example `#ref` declarations generated by the `--refs=` argument. They include an identifier and a base64-encoded hash. ```cherri #ref GoLogo_Bluesvg eyJmaWxlbmFtZSI6IkdvLUxvZ29fQmx1ZS4... ``` ```cherri #ref AMGoldSeriesReissue eyJwZXJzaXN0ZW50SWRlbnRpZmllcii... ``` -------------------------------- ### Cherri Package Trust Prompt Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/package-manager.md Example of the trust prompt displayed when installing a remote Cherri package for the first time. Review packages before trusting. ```text Do you trust this package? This will download this remote Git repository and automatically include it in this project: https://{uri}/{package_author}/cherri-{package_name}.git ``` -------------------------------- ### Example Built-in Action Definition in Go Source: https://github.com/electrikmilk/cherrilang.org/blob/main/compiler/actions.md An example of defining a built-in action named 'takePhoto' in Go. It includes parameter definitions with types, keys, and default values, along with a function to add parameters. ```go actions["takePhoto"] = actionDefinition{ parameters: []parameterDefinition{ { field: "showPreview", validType: Bool, key: "WFCameraCaptureShowPreview", defaultValue: true, }, }, addParams: func(_ []actionArgument) map[string]any { return map[string]any{ "WFPhotoCount": 1 } }, } ``` -------------------------------- ### Install a Cherri Package Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/package-manager.md Command to install a Cherri package and its dependencies. The package will be cloned to the ./packages directory. ```console cherri --install=@{package_author}/{package_name} ``` -------------------------------- ### Get Apps Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/macos-only.md Get a list of applications installed on the macOS system. ```APIDOC ## Get Apps ### Description Get list of applications. ### Method getApps() ### Returns - array: A list of applications. ``` -------------------------------- ### Start Timer Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/calendar.md Creates and starts a new timer with an optional duration. ```APIDOC ## Start Timer ### Description Creates a new timer. ### Signature startTimer(timeDuration ?duration = qty(0, "min")) ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Parameters - **duration** (timeDuration, optional) - The duration for the timer. Defaults to 0 minutes. ### Returns - None ``` -------------------------------- ### Get List of Applications Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/macos-only.md Retrieves a list of all applications installed on the macOS system. This action is specific to macOS. ```applescript getApps(): array ``` -------------------------------- ### Start Screensaver Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/macos-only.md Starts the screensaver on the Mac. ```APIDOC ## Start Screensaver ### Description Start screensaver. ### Method startScreensaver() ``` -------------------------------- ### Record Audio Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/media.md Prompts the user to record audio with specified quality and start behavior. Quality options are Normal and Very High. Start options are On Tap and Immediately. Defaults to Normal quality and On Tap start. Requires an include statement for 'actions/media'. ```action enum audioQuality { 'Normal', 'Very High', } enum audioStart { 'On Tap', 'Immediately', } recordAudio(audioQuality ?quality = "Normal", audioStart ?start = "On Tap") ``` -------------------------------- ### Install Cherri via Homebrew Source: https://github.com/electrikmilk/cherrilang.org/blob/main/install.md Install the Cherri package using Homebrew after adding the tap. This is the recommended method for macOS and Linux users. ```bash brew install electrikmilk/cherri/cherri ``` -------------------------------- ### List Cherri Packages Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/package-manager.md Commands to list installed Cherri packages. Use --package for the current project's dependencies and --packages for all installed packages. ```console cherri --package # current package and its direct dependencies ``` ```console cherri --packages # all installed packages ``` -------------------------------- ### Get Windows Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/macos-only.md Get a list of open windows on the macOS system, with sorting and limiting options. ```APIDOC ## Get Windows ### Description Get list of windows. ### Method getWindows(windowSorting ?sortBy, sortOrder ?orderBy, number ?limit) ### Parameters - **sortBy** (windowSorting, optional) - The criteria to sort windows by. - **orderBy** (sortOrder, optional) - The order to sort the windows (ascending or descending). - **limit** (number, optional) - The maximum number of windows to return. ### Enums #### windowSorting - 'Title' - 'App Name' - 'Width' - 'Height' - 'X Position' - 'Y Position' - 'Window Index' - 'Name' - 'Random' #### sortOrder - 'asc' - 'desc' ``` -------------------------------- ### Start Shazam Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/media.md Starts Shazam to recognize music playing. ```APIDOC ## Start Shazam ### Description Prompt the user to play music for Shazam to recognize. Returns Shazam result. ### Method startShazam(bool ?show = true, bool ?showError = true) ``` -------------------------------- ### Take Video Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/media.md Prompts the user to start recording a video. ```APIDOC ## Take Video ### Description Prompts the user to start recording a video. ### Method takeVideo(cameraOrientation ?camera = "Front", videoQuality ?quality = "High", recordingStart ?recordingStart = "Immediately") ### Enums #### cameraOrientation - 'Front' - 'Back' #### videoQuality - 'Low' - 'Medium' - 'High' #### recordingStart - 'On Tap' - 'Immediately' ``` -------------------------------- ### Play Music Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/music.md Starts or resumes music playback. ```actions play() ``` -------------------------------- ### Start Point & Speak Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/a11y.md Initiates the point and speak feature of Magnifier. ```APIDOC ## Start Point & Speak ### Description Initiates the point and speak feature of Magnifier. ### Method N/A (Function Signature) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ``` magnifierPointAndSpeak() ``` **Note:** Only supported on iOS/iPadOS. ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### adjustDate Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/calendar.md Adjust a date or get the start of a time period. It takes a date string, an operation (Add, Subtract, Get Start of Minute, etc.), and an optional unit (sec, min, hr, days, etc.) to perform the adjustment. ```APIDOC ## adjustDate ### Description Adjust a date or get the start of a time period. ### Signature ``` adjustDate(text date, dateAdjustOperation operation, dateUnit ?unit): date ``` ### Parameters #### Path Parameters - **date** (text) - Description: The date string to adjust. - **operation** (dateAdjustOperation) - Description: The operation to perform (e.g., 'Add', 'Subtract', 'Get Start of Minute'). - **unit** (dateUnit, optional) - Description: The unit for the adjustment (e.g., 'sec', 'min', 'hr'). ### Returns - **date** - The adjusted date or the start of the specified time period. ``` -------------------------------- ### View All Standard Actions Documentation Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/index.md Provide no arguments to this command to display documentation for all standard actions. This is useful for a comprehensive overview. ```bash cherri --docs=category --subcat=optional ``` -------------------------------- ### Create a 'Hello, World!' Cherri Shortcut Source: https://github.com/electrikmilk/cherrilang.org/blob/main/getting-started.md This snippet demonstrates the basic structure of a Cherri file, including metadata, constants, and actions. It's used to create a simple alert message. ```ruby /* Hello, World! Shortcut */ #define glyph smileyFace #define color yellow // Display a greeting const message = "Hello, Cherri!" alert("{message}", "My First Shortcut") ``` -------------------------------- ### Get List Items by Range Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/basic.md Extracts a range of items from a list based on start and end indexes. Remember that list indexing starts at 1. ```CherriLang getListItems(variable list, number start, number end): array ``` -------------------------------- ### Connect to Server Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/network.md Establishes a connection to a file server at the specified URL. ```cherri connectToServer(text url) ``` -------------------------------- ### Get Item Name Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/basic.md Retrieves the name of a given item. No specific setup is required. ```CherriLang getName(variable item) ``` -------------------------------- ### Show Input Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/basic.md Use `show` to display input text. This is a straightforward command for presenting text. ```cherri show(text input) ``` -------------------------------- ### Get Last List Item Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/basic.md Retrieves the last item from a list. List indexing starts at 1. ```CherriLang getLastItem(variable list): variable ``` -------------------------------- ### Chatbot Example with Follow Up Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/intelligence.md Use this to prompt an LLM to act as a helpful assistant and enable follow-up prompts for continued conversation. ```ruby #include 'actions/intelligence' askCloudLLM("You are a helpful assistant.", true) ``` -------------------------------- ### Get First List Item Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/basic.md Retrieves the first item from a list. List indexing starts at 1. ```CherriLang getFirstItem(variable list): variable ``` -------------------------------- ### Get File Link Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/documents.md Generates a shareable link for a given file. ```actions getFileLink(variable file) ``` -------------------------------- ### Get All Shortcuts Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/shortcuts.md Retrieves an array containing all shortcuts available on the device. ```actions getShortcuts(): array ``` -------------------------------- ### Start Timer Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/calendar.md Creates a new timer with a specified duration. The duration can be set in hours, minutes, or seconds. ```CherriLang enum timeDuration { 'hr', 'min', 'sec', } startTimer(timeDuration ?duration = qty(0, "min")) ``` -------------------------------- ### Lists - Get List Items Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/basic.md Retrieves a range of items from a list using start and end indexes (1-based). ```APIDOC ## Lists - Get List Items ### Description Get items from a `list` between two indexes. Keep in mind Shortcuts starts counting indexes at 1. ### Signature `getListItems(variable list, number start, number end): array` ``` -------------------------------- ### Define Action with Parameter and Output Type Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/action-definitions.md Define an action that accepts a file input and returns a boolean. The parameter key 'WFInput' is specified. ```cherri action 'com.example.app.action' myCustomAction(variable file: 'WFInput'): bool @file = selectFile() myCustomAction(@file) ``` -------------------------------- ### Initialize a Cherri Package Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/package-manager.md Command to initialize a new Cherri package by creating an info.plist file in the current directory. ```console cherri --init=@{package_author}/{package_name} ``` -------------------------------- ### Adjust Date Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/calendar.md Adjusts a date by adding or subtracting time units, or gets the start of a specific time period (minute, hour, day, week, month, year). ```typescript enum dateAdjustOperation { 'Add', 'Subtract', 'Get Start of Minute', 'Get Start of Hour', 'Get Start of Day', 'Get Start of Week', 'Get Start of Month', 'Get Start of Year', } enum dateUnit { 'sec', 'min', 'hr', 'days', 'weeks', 'months', 'yr', } adjustDate(text date, dateAdjustOperation operation, dateUnit ?unit): date ``` -------------------------------- ### Create a Menu Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/menus.md Use this syntax to create a menu with a prompt and selectable items. Item labels can be variables or literals. ```ruby menu "Prompt" { item "Item 1": /* do stuff if selected... */ item "Item 2": /* do other stuff if selected... */ } ``` -------------------------------- ### Get File Detail Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/documents.md Retrieves a specific detail about a file, such as its size, extension, or creation date. ```actions enum fileDetail { 'File Size', 'File Extension', 'Creation Date', 'File Path', 'Last Modified Date', 'Name', } getFileDetail(variable file, fileDetail detail) ``` -------------------------------- ### Example: Show Alert Action Definition Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/action-definitions.md Defines and demonstrates the usage of a custom 'Show Alert' action with various parameters. Supports optional title and cancel button. ```cherri action 'alert' showAlert( text message: 'WFAlertActionMessage', text ?title: 'WFAlertActionTitle', bool ?cancelButton: 'WFAlertActionCancelButtonShown' = true ) showAlert("Hello, Cherri!") showAlert("Hello, Cherri!", "Alert") showAlert("Hello, Cherri!", "Alert", false) ``` -------------------------------- ### Get Event Detail Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/calendar.md Get a detail of an event. ```APIDOC ## Get Event Detail Get a detail of an event. ### Method Signature ``` getEventDetail(variable event, eventDetail detail) ``` ### Enum: eventDetail ``` enum eventDetail { 'Start Date', 'End Date', 'Is All Day', 'Calendar', 'Location', 'Has Alarms', 'Duration', 'Is Canceled', 'My Status', 'Organizer', 'Organizer Is Me', 'Attendees', 'Number of Attendees', 'URL', 'Title', 'Notes', 'Attachments', 'File Size', 'File Extension', 'Creation Date', 'File Path', 'Last Modified Date', 'Name', } ``` ``` -------------------------------- ### Select File Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/documents.md Prompts the user to select one or multiple files. Configure to allow multiple selections. ```actions selectFile(bool ?selectMultiple = false) ``` -------------------------------- ### CherriLang Includes for Project Management Source: https://github.com/electrikmilk/cherrilang.org/blob/main/index.md Shows how to include multiple files and files within folders to manage large Shortcut projects. ```ruby #include 'other-file.cherri' // ... #include 'another-file.cherri' ``` -------------------------------- ### Get Current Location Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/location.md A function to explicitly get the current location. ```APIDOC ## Get Current Location ### Description Get current user location. ### Method ``` getCurrentLocation() ``` ``` -------------------------------- ### Get Clipboard Contents Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/sharing.md Retrieves the current content of the system clipboard. ```cherri getClipboard() ``` -------------------------------- ### Preview Input with Quick Look Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/basic.md Use `quicklook` to preview input data. This function is useful for inspecting variables. ```cherri quicklook(variable input) ``` -------------------------------- ### Get Podcasts Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/media.md Retrieves a list of the user's podcasts. Requires an include statement for 'actions/media'. ```action getPodcasts() ``` -------------------------------- ### Make Archive Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/documents.md Creates an archive from a list of files. Specify the desired archive format and an optional name. ```actions enum archiveFormat { '.zip', '.tar.gz', '.tar.bz2', '.tar.xz', '.tar', '.gz', '.cpio', '.iso', } makeArchive(variable files, archiveFormat ?format = ".zip", text ?name) ``` -------------------------------- ### Play Music Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/music.md Starts playing music with options for shuffle and repeat modes. ```APIDOC ## Play Music ### Description Set music to play with modes for shuffle and repeat. ### Method N/A (Function Call) ### Signature `playMusic(variable music, shuffleMode ?shuffle, repeatMode ?repeat)` ### Enums #### shuffleMode - 'Off' - 'Songs' #### repeatMode - 'None' - 'One' - 'All' ``` -------------------------------- ### Include Standard Libraries and Define Comments Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/functions.md This snippet shows how to include necessary libraries and add instructional comments at the beginning of a Cherri script. Comments added this way are prioritized and placed at the top of the compiled Shortcut. ```ruby #include 'stdlib' #include 'actions/text' #include 'actions/web' comment('Contact me: brandon@cherrilang.org') runJS("console.log('Hello, World!')") ``` -------------------------------- ### Compile Cherri Binary Source: https://github.com/electrikmilk/cherrilang.org/blob/main/install.md Build the Cherri executable from the source code using the Go compiler. This command should be run from within the Cherri source directory. ```bash go build ``` -------------------------------- ### Get Device OS Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/variables-constants-globals.md Retrieve the device's operating system and store it in a variable. ```ruby @deviceOS = "OS: {Device['OS']}" ``` -------------------------------- ### Choose from vCard Example Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/stdlib.md Prompts the user to select an item from a provided array of vCards. Requires including 'stdlib', 'actions/text', and 'actions/web'. ```ruby #include 'stdlib' #include 'actions/text' #include 'actions/web' @items = [] repeat i for 3 { @items += makeVCard("Title", "Subtitle") } chooseFromVCard(items, "Choose From Items") ``` -------------------------------- ### Connect to Server Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/network.md Establishes a connection to a file server at the specified URL. ```APIDOC ## Connect to Server ### Description Connect to file server at `url`. ### Method `connectToServer(text url)` ### Parameters #### Path Parameters - **url** (text) - Required - The URL of the file server to connect to. ``` -------------------------------- ### Get File Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/documents.md Retrieves a file from a specified path. Can optionally raise an error if the file is not found. ```actions getFile(text path, &variable ?folder, bool ?errorIfNotFound = true) ``` -------------------------------- ### Run Current Shortcut Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/shortcuts.md Executes the currently running shortcut, with an option to pass output data. ```actions runSelf(variable output) ``` -------------------------------- ### Get Selected Files Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/documents.md Retrieves a list of files that are currently selected by the user. ```actions getSelectedFiles() ``` -------------------------------- ### Cherri Package Metadata (info.plist) Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/package-manager.md Example XML structure for the info.plist file, which contains essential package metadata and dependencies. ```xml Name package_name User package_author Packages ``` -------------------------------- ### Get Current Song Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/music.md Retrieves information about the currently playing song. ```actions getCurrentSong() ``` -------------------------------- ### Compile Shortcut Source: https://github.com/electrikmilk/cherrilang.org/blob/main/migration.md Compile a Cherri shortcut file using the `cherri` command. Fix any compilation errors before testing on a device. ```console cherri my-shortcut.cherri ``` -------------------------------- ### currentDate Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/calendar.md Get the current date and time. ```APIDOC ## currentDate ### Description Get the current date. ### Signature ``` currentDate(): date ``` ### Returns - **date** - The current date. ``` -------------------------------- ### Start Screensaver Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/macos-only.md Initiates the screensaver on a macOS device. This action is only supported on macOS. ```applescript startScreensaver() ``` -------------------------------- ### Get Alarms Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/calendar.md Returns all of the alarms on the device. ```APIDOC ## Get Alarms Returns all of the alarms on the device. ### Method Signature ``` getAlarms() ``` ``` -------------------------------- ### Create Shortcut Link Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/shortcuts.md Use this action to create a shortcut link. ```actions createShortcutLink(variable shortcut) ``` -------------------------------- ### Get Text from Image Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/text.md Extracts text from an image. ```APIDOC ## Get Text from Image ### Description Extracts text from an image. ### Signature getTextFromImage(variable image): text ``` -------------------------------- ### Open File Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/documents.md Opens a file using the default application. Optionally prompts the user before opening. ```actions openFile(&variable file, bool ?askWhenRun = false) ``` -------------------------------- ### Get Article from Webpage Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/web.md Retrieves article content from a given webpage URL. ```actions getArticle(text webpage) ``` -------------------------------- ### Get Orientation Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/device.md Retrieves the current orientation of the device. ```APIDOC ## Get Orientation ### Description Get the current orientation of the device. ### Method getOrientation ### Response #### Success Response - **text** (text) - The current orientation of the device (e.g., 'Portrait', 'Landscape'). ``` -------------------------------- ### Chaining Example Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/intelligence.md Illustrates chaining multiple LLM calls together to perform sequential private inference tasks, such as summarizing clipboard content and identifying its topic. ```APIDOC #include 'actions/intelligence' const clipboardSummary = askCloudLLM("Summarize the following text: {Clipboard}") const topic = askCloudLLM("Return the topic of the described in the text: {clipboardSummary})") ``` -------------------------------- ### Get Clipboard Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/sharing.md Retrieves the current contents of the clipboard. ```APIDOC ## Get Clipboard ### Description Get the contents of the clipboard. ### Method Signature `getClipboard()` ``` -------------------------------- ### Run Self Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/shortcuts.md Runs the current Shortcut, optionally providing output. Usage requires the '#include \'actions/shortcuts\'' statement. ```APIDOC ## Run Self ### Description Run the current Shortcut with optional output. ### Method `runSelf(variable output)` ### Parameters #### Path Parameters - **output** (variable) - Optional - The output to provide to the current shortcut. ### Request Example ``` runSelf(data) ``` ``` -------------------------------- ### Get Shortcuts Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/shortcuts.md Retrieves all Shortcuts available on the device. Usage requires the '#include \'actions/shortcuts\'' statement. ```APIDOC ## Get Shortcuts ### Description Get all of the Shortcuts on the device. ### Method `getShortcuts(): array` ### Response #### Success Response (200) - **array** - An array containing all shortcuts. ### Request Example ``` getShortcuts() ``` ``` -------------------------------- ### Make PDF Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/pdf.md Creates a PDF file from provided input data. Supports different merge behaviors for combining content and an option to include margins. ```action enum PDFMergeBehaviors { 'Append', 'Shuffle', } makePDF(variable input, bool ?includeMargin = false, PDFMergeBehaviors ?mergeBehavior = "Append") ``` -------------------------------- ### Get Addresses Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/location.md Retrieves addresses based on input. ```APIDOC ## Get Addresses ### Description Get addresses from `input`. ### Method ``` getAddresses(variable input) ``` ``` -------------------------------- ### Select Folder Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/documents.md Prompts the user to select one or multiple folders. Configure to allow multiple selections. ```actions selectFolder(bool ?selectMultiple = false) ``` -------------------------------- ### Get Contacts Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/contacts.md Retrieves contacts from a given input. ```APIDOC ## Get Contacts ### Description Get contacts from input. ### Signature `getContacts(variable input): array` ``` -------------------------------- ### Get On-Screen Content Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/device.md Captures and returns the content currently displayed on the device's screen. ```action getOnScreenContent() ``` -------------------------------- ### Show In iTunes Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/media.md Displays a product in the iTunes store. ```APIDOC ## Show In iTunes ### Description Displays a product in the iTunes store. ### Method showIniTunes(variable product) ``` -------------------------------- ### Run Cherri Binary Source: https://github.com/electrikmilk/cherrilang.org/blob/main/install.md Execute the compiled Cherri binary. This confirms that the build was successful. ```bash ./cherri ``` -------------------------------- ### Get File Detail Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/documents.md Retrieves a specific detail about a file. ```APIDOC ## Get File Detail Get a detail about a file. ### Enum: fileDetail ``` enum fileDetail { 'File Size', 'File Extension', 'Creation Date', 'File Path', 'Last Modified Date', 'Name', } ``` ### Function Signature ``` getFileDetail(variable file, fileDetail detail) ``` ``` -------------------------------- ### Basic Action Usage in CherriLang Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/actions.md Demonstrates the fundamental syntax for calling an action in CherriLang, similar to a function call. ```ruby alert("Hello, Cherri!") ``` -------------------------------- ### Numbers - Get Numbers Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/basic.md Extracts numbers from a given input. ```APIDOC ## Numbers - Get Numbers ### Description Get numbers from input. ### Signature `getNumbers(variable input): number` ``` -------------------------------- ### Items - Get Name Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/basic.md Retrieves the name of a given item. ```APIDOC ## Items - Get Name ### Description Get the name of an item. ### Signature `getName(variable item)` ``` -------------------------------- ### Get URLs Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/web.md Extracts URLs from a given input text. ```APIDOC ## Get URLs ### Description Get URLs from `input`. ### Method N/A (Function Call) ### Parameters - **input** (text) - Required - The text to extract URLs from. ### Returns - array: A list of URLs found in the input. ``` -------------------------------- ### Get URL Detail Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/web.md Retrieves a specific component of a URL. ```APIDOC ## Get URL Detail ### Description Get a detail about a URL. ### Method N/A (Function Call) ### Parameters - **url** (text) - Required - The URL to analyze. - **detail** (URLDetail) - Required - The specific component to retrieve (e.g., 'Scheme', 'Host'). ### Enum URLDetail - 'Scheme' - 'User' - 'Password' - 'Host' - 'Port' - 'Path' - 'Query' - 'Fragment' ``` -------------------------------- ### Run Shortcut Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/shortcuts.md Runs a specified shortcut with given input. Usage requires the '#include \'actions/shortcuts\'' statement. ```APIDOC ## Run Shortcut ### Description Run Shortcut with name `shortcutName`, providing it with `input`. ### Method `run(text shortcutName, variable input)` ### Parameters #### Path Parameters - **shortcutName** (text) - Required - The name of the shortcut to run. - **input** (variable) - Required - The input to provide to the shortcut. ### Request Example ``` run('My Shortcut', myData) ``` ``` -------------------------------- ### Get Text Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/text.md Retrieves text from a specified input variable. ```APIDOC ## Get Text ### Description Get text from input. ### Signature getText(variable input): text ``` -------------------------------- ### Get URL Detail Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/web.md Extracts a specific component from a URL, such as 'Scheme', 'Host', 'Path', or 'Query'. ```actions enum URLDetail { 'Scheme', 'User', 'Password', 'Host', 'Port', 'Path', 'Query', 'Fragment', } getURLDetail(text url, URLDetail detail) ``` -------------------------------- ### Get Article Detail Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/web.md Retrieves a specific detail about an article. ```APIDOC ## Get Article Detail ### Description Retrieves a specific detail (e.g., title, author) about an article. ### Method N/A (Function Call) ### Parameters - **article** (variable) - Required - The article object or identifier. - **detail** (text) - Required - The specific detail to retrieve (e.g., 'Title', 'Author'). ``` -------------------------------- ### Choose from a List Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/menus.md Use the `chooseFromList()` action with a predefined list and a prompt to allow user selection. The chosen item is stored in a variable. ```ruby @list = list("Item 1", "Item 2", "Item 3") @chosenItem = chooseFromList(@list,"Choose a item") ``` -------------------------------- ### Get Current Date Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/calendar.md Retrieves the current date and time. ```typescript currentDate(): date ``` -------------------------------- ### Get File Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/documents.md Retrieves a file from a specified path within the Shortcuts folder or a referenced folder. ```APIDOC ## Get File Get file from a path in the Shortcuts folder or within a `#ref` to a folder. ### Function Signature ``` getFile(text path, &variable ?folder, bool ?errorIfNotFound = true) ``` ``` -------------------------------- ### Create Shortcut Link Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/shortcuts.md Creates a shortcut link. Usage requires the '#include \'actions/shortcuts\'' statement. ```APIDOC ## Create Shortcut Link ### Description Creates a shortcut link. ### Method `createShortcutLink(variable shortcut)` ### Parameters #### Path Parameters - **shortcut** (variable) - Required - The shortcut variable to link. ### Request Example ``` createShortcutLink(myShortcut) ``` ``` -------------------------------- ### Get Article Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/web.md Retrieves article content from a given webpage. ```APIDOC ## Get Article ### Description Retrieves the main article content from a specified webpage. ### Method N/A (Function Call) ### Parameters - **webpage** (text) - Required - The URL of the webpage to scrape. ``` -------------------------------- ### Get Last Import Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/photos.md Retrieves the last imported photos. ```cherri getLastImport() ``` -------------------------------- ### Navigate to Cherri Directory Source: https://github.com/electrikmilk/cherrilang.org/blob/main/install.md Change your current directory to the cloned Cherri source code directory. This is necessary before compiling. ```bash cd /path/to/cherri ``` -------------------------------- ### Get Podcasts Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/media.md Retrieves a list of the user's podcasts. ```APIDOC ## Get Podcasts ### Description Get users podcasts. ### Method getPodcasts() ``` -------------------------------- ### Get Podcast Detail Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/media.md Retrieves specific details about a podcast. ```APIDOC ## Get Podcast Detail ### Description Retrieves specific details about a podcast. ### Method getPodcastDetail(variable podcast, podcastDetail detail) ### Enums #### podcastDetail - 'Feed URL' - 'Genre' - 'Episode Count' - 'Artist' - 'Store ID' - 'Store URL' - 'Artwork' - 'Artwork URL' - 'Name' ``` -------------------------------- ### Create a vCard Menu Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/vcards.md Generates a vCard menu with a specified number of items. It then flattens the items into text, creates a contact card file, and uses `chooseFromList` to prompt the user. The chosen item's title is then displayed. ```ruby /* Generate items */ @items = [] repeat i for 3 { @items += makeVCard("Title {@i}", "Subtitle {@i}") } /* Flatten items to text */ @menuItems = "{@items}" /* Create contact card file */ @vcf = setName(@menuItems, "menu.vcf") /* Coerce type to contact */ @contact = @vcf.contact /* Use chooseFromList to prompt the user with our menu */ @chosenItem = chooseFromList(@contact, "Prompt") /* chosenItem contains the title of the chosen item */ alert(@chosenItem, "You chose:") ``` -------------------------------- ### Get Images Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/images.md Detect and retrieve images from a given input. ```APIDOC ## Get Images ### Description Detect images in input ### Method getImages ### Parameters #### Path Parameters - **variable input** - Description ### Returns - **array** - Description ``` -------------------------------- ### Get Image Frames Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/images.md Retrieve all frames from a given GIF. ```APIDOC ## Get Image Frames ### Description Get frames from a GIF. ### Method getImageFrames ### Parameters #### Path Parameters - **variable image** - Description ``` -------------------------------- ### Show In iTunes Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/media.md Displays a product in the iTunes store. Requires an include statement for 'actions/media'. ```action showIniTunes(variable product) ``` -------------------------------- ### Get GIF Frames Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/images.md Extracts all frames from a given GIF. ```cherrilang getImageFrames(variable image) ``` -------------------------------- ### Create Folder Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/documents.md Creates a new folder. Can be within the Shortcuts folder or a referenced folder. ```actions createFolder(text path, &variable ?folder) ``` -------------------------------- ### Import Standard Shortcuts Actions Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/import-actions.md Import the built-in standard Shortcuts actions using their bundle identifier. These actions are often written in Cherri and are generally recommended for easier use. ```bash #import 'is.workflow.actions' ``` -------------------------------- ### FaceTime Call Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/contacts.md Starts a FaceTime audio or video call with a contact. ```APIDOC ## FaceTime Call ### Description Starts a FaceTime audio or video call with the contact. ### Signature `facetimeCall(variable contact, facetimeCallType ?type = "Video")` ### Enums `facetimeCallType`: 'Video', 'Audio' ``` -------------------------------- ### Get File From Folder Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/documents.md Retrieves a file from a specific folder. Use '~' to access the home folder on macOS. ```actions getFileFromFolder(text folder, text path, bool ?errorIfNotFound = true) ``` -------------------------------- ### Search for App Actions Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/import-actions.md Use the `--action=` argument with the Cherri CLI to list available actions for a specified app. This helps in discovering and understanding the available action types for integration. ```bash cherri file.cherri --action=appname ``` -------------------------------- ### Get Selected Files Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/documents.md Retrieves a list of files that are currently selected. ```APIDOC ## Get Selected Files ``` getSelectedFiles() ``` ``` -------------------------------- ### Compile a Cherri Shortcut Source: https://github.com/electrikmilk/cherrilang.org/blob/main/getting-started.md This command compiles a Cherri source file into a shortcut file. No output indicates a successful compilation. ```console cherri hello.cherri ``` -------------------------------- ### Get Parent Directory Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/documents.md Returns the parent directory of a given directory. ```APIDOC ## Get Parent Directory Get the parent directory of the input directory. ### Function Signature ``` getParentDirectory(&variable input) ``` ``` -------------------------------- ### Get File Link Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/documents.md Generates a shareable link for a given file. ```APIDOC ## Get File Link Get a link for the provided file. ### Function Signature ``` getFileLink(variable file) ``` ``` -------------------------------- ### Get Device Details and Battery Level Source: https://github.com/electrikmilk/cherrilang.org/blob/main/getting-started.md Use standard actions to retrieve device information like name, model, OS version, and current battery level. Ensure the 'actions/device' module is included. ```ruby #include 'actions/device' #define glyph phone #define color lightblue const deviceName = getDeviceDetail("Device Name") const model = getDeviceDetail("Device Model") const osVersion = getDeviceDetail("System Version") const battery = getBatteryLevel() show("Device: {deviceName}\nModel: {model}\nOS: {osVersion}\nBattery: {battery}%") ``` -------------------------------- ### Get Parent Directory Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/documents.md Returns the parent directory of the input directory. ```actions getParentDirectory(&variable input) ``` -------------------------------- ### Action Definition with Simple Parameter in Go Source: https://github.com/electrikmilk/cherrilang.org/blob/main/compiler/actions.md Example of defining an action with a simple boolean parameter that has a default value and a specific key. ```go actions["takePhoto"] = actionDefinition{ parameters: []parameterDefinition{ { name: "showPreview", validType: Bool, key: "WFCameraCaptureShowPreview" defaultValue: actionArgument{ valueType: Bool, value: true, }, }, }, } ``` -------------------------------- ### Initialize a Variable Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/variables-constants-globals.md Use this syntax to initialize a variable and assign it a text value. ```ruby @identifier = "value" ``` -------------------------------- ### Get Match Groups Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/text.md Retrieves all match groups from a set of matches. ```APIDOC ## Get Match Groups ### Description Get all groups in `matches`. ### Signature getMatchGroups(variable matches) ``` -------------------------------- ### Lists - Get Random Item Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/basic.md Retrieves a random item from a list. ```APIDOC ## Lists - Get Random Item ### Description Get random item from list. ### Signature `getRandomItem(variable list): variable` ``` -------------------------------- ### Lists - Get Last Item Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/basic.md Retrieves the last item from a list. ```APIDOC ## Lists - Get Last Item ### Description Get the last item in a list. ### Signature `getLastItem(variable list): variable` ``` -------------------------------- ### Select File Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/documents.md Prompts the user to select one or multiple files. ```APIDOC ## Select File Prompt the user to select one or optionally multiple files. ### Function Signature ``` selectFile(bool ?selectMultiple = false) ``` ``` -------------------------------- ### Lists - Get First Item Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/basic.md Retrieves the first item from a list. ```APIDOC ## Lists - Get First Item ### Description Get first item in a list. ### Signature `getFirstItem(variable list): variable` ``` -------------------------------- ### Create Album Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/photos.md Creates a new album with an optional set of initial images. ```cherri createAlbum(text name, variable ?images) ``` -------------------------------- ### Get Webpage Detail Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/web.md Retrieves a specific detail about a webpage from Safari. ```APIDOC ## Get Webpage Detail ### Description Get a detail about a provided webpage. ### Method N/A (Function Call) ### Parameters - **webpage** (variable) - Required - The webpage object or identifier. - **detail** (webpageDetail) - Required - The specific detail to retrieve (e.g., 'Page Contents', 'Page URL'). ### Enum webpageDetail - 'Page Contents' - 'Page Selection' - 'Page URL' - 'Name' ``` -------------------------------- ### Prepend to File Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/documents.md Prepends text content to the beginning of a specified file. Use this for adding headers or initial data. ```actions prependToFile(text filePath, &variable text) ``` -------------------------------- ### Get Webpage Contents Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/web.md Retrieves the content of a webpage from within Safari. ```APIDOC ## Get Webpage Contents ### Description Get contents of Webpage from Safari. ### Method N/A (Function Call) ### Parameters - **url** (text) - Required - The URL of the webpage. ``` -------------------------------- ### Get Dates from Input Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/calendar.md Extracts date values from a given input. ```typescript getDates(variable input) ``` -------------------------------- ### Open Custom X-Callback URL Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/web.md Opens a custom URL with optional keys for success, cancellation, and error handling, as well as a success URL. ```actions openCustomXCallbackURL(text url, text ?successKey, text ?cancelKey, text ?errorKey, text ?successURL) ``` -------------------------------- ### Get URLs from Input Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/web.md Extracts URLs from a given text input. ```actions getURLs(text input): array ``` -------------------------------- ### CherriLang Macros for Compile-Time Code Copying Source: https://github.com/electrikmilk/cherrilang.org/blob/main/index.md Illustrates the use of macros to copy and paste code automatically at compile-time in CherriLang. ```ruby #include 'actions/network' copy checkConnection { const online = isOnline() if !online { alert("No internet connection") } } // ... paste checkConnection ``` -------------------------------- ### Get Type Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/basic.md Determines and returns the data type of the provided input. ```APIDOC ## Get Type ### Description Get the type of input. ### Signature `typeOf(variable input): text` ``` -------------------------------- ### Get Text from Input Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/text.md Retrieves text from a specified input variable. ```text getText(variable input): text ``` -------------------------------- ### Get Article Detail Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/web.md Extracts a specific detail from an article object. ```actions getArticleDetail(variable article, text detail) ``` -------------------------------- ### Define and Use an Import Question Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/import-questions.md Define a question with an identifier, prompt, and default value. Reference the identifier to use the question's value in an action. Note that identifiers can only be used once per action argument. ```ruby #question name "Enter Your Name" "Siri" alert(name, "Hello") ``` -------------------------------- ### Skip Back Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/music.md Navigates to the previous song in the queue. ```actions skipBack() ``` -------------------------------- ### Get Multitasking Mode Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/settings.md Retrieves the current multitasking mode of the device. ```APIDOC ## Get Multitasking Mode ### Description Retrieves the current multitasking mode of the device. ### Signature getMultitaskingMode(): text ``` -------------------------------- ### Open Shortcut Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/shortcuts.md Opens a specified shortcut in the Shortcuts app. Usage requires the '#include \'actions/shortcuts\'' statement. ```APIDOC ## Open Shortcut ### Description Open a shortcut in the Shortcuts app. ### Method `openShortcut(text shortcutName)` ### Parameters #### Path Parameters - **shortcutName** (text) - Required - The name of the shortcut to open. ### Request Example ``` openShortcut('My Favorite Shortcut') ``` ``` -------------------------------- ### Get Wallpapers Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/settings.md Retrieves all available device wallpapers. Only supported on iOS/iPadOS. ```APIDOC ## Get Wallpapers ### Description Retrieves all available device wallpapers. Only supported on iOS/iPadOS. ### Signature getAllWallpapers(): array ``` -------------------------------- ### Open X-Callback URL Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/web.md Opens a URL that supports the x-callback-url scheme. ```actions openXCallbackURL(text url) ``` -------------------------------- ### Get Wallpaper Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/settings.md Retrieves the current device wallpaper. Only supported on iOS/iPadOS. ```APIDOC ## Get Wallpaper ### Description Retrieves the current device wallpaper. Only supported on iOS/iPadOS. ### Signature getWallpaper() ``` -------------------------------- ### Get Music Detail Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/music.md Retrieves a specific detail about a given song. ```APIDOC ## Get Music Detail ### Description Get a detail about a song. ### Method N/A (Function Call) ### Signature `getMusicDetail(variable music, musicDetail detail)` ### Enums #### musicDetail - 'Title' - 'Album' - 'Artist' - 'Album Artist' - 'Genre' - 'Composer' - 'Date Added' - 'Media Kind' - 'Duration' - 'Play Count' - 'Track Number' - 'Disc Number' - 'Album Artwork' - 'Is Explicit' - 'Lyrics' - 'Release Date' - 'Comments' - 'Is Cloud Item' - 'Skip Count' - 'Last Played Date' - 'Rating' - 'File Path' - 'Name' ``` -------------------------------- ### Get Current Song Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/music.md Retrieves information about the currently playing song. ```APIDOC ## Get Current Song ### Description Gets the currently playing song. ### Method N/A (Function Call) ### Signature `getCurrentSong()` ``` -------------------------------- ### Define Input and Output Types Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/definitions.md Specify the input and output types for your Shortcut using the `#define inputs` and `#define outputs` directives. Commas must separate multiple types. Inputs default to all types, and outputs default to no types. ```ruby #define inputs image, text #define outputs app, file alert(ShortcutInput) ``` -------------------------------- ### Select Folder Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/documents.md Prompts the user to select one or multiple folders. ```APIDOC ## Select Folder Prompt the user to select one or optionally multiple folders. ### Function Signature ``` selectFolder(bool ?selectMultiple = false) ``` ``` -------------------------------- ### Make Shortcut Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/shortcuts.md Creates a new shortcut with a specified name. Usage requires the '#include \'actions/shortcuts\'' statement. ```APIDOC ## Make Shortcut ### Description Create a shortcut. ### Method `makeShortcut(text name, bool ?open = true)` ### Parameters #### Path Parameters - **name** (text) - Required - The name of the shortcut to create. - **open** (bool) - Optional - Whether to open the shortcut after creation. Defaults to true. ### Request Example ``` makeShortcut('My New Shortcut') ``` ``` -------------------------------- ### Play Music Next Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/music.md Adds music to play immediately after the current song. ```actions playNext(variable music) ``` -------------------------------- ### Get Latest Videos Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/photos.md Retrieves the latest videos, up to the specified count. ```APIDOC ## Get Latest Videos ### Description Retrieves the latest videos, up to the specified count. ### Signature `getLatestVideos(number count)` ``` -------------------------------- ### Show Quick Note Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/documents.md Displays a quick note interface to the user. ```APIDOC ## Show Quick Note ### Description Show quick note. ### Signature showQuickNote() ``` -------------------------------- ### Get Latest Screenshots Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/photos.md Retrieves the latest screenshots, up to the specified count. ```APIDOC ## Get Latest Screenshots ### Description Retrieves the latest screenshots, up to the specified count. ### Signature `getLatestScreenshots(number count)` ``` -------------------------------- ### Access Offline Documentation Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/index.md Use this command to access documentation for actions offline from the CLI. It will find the action or suggest alternatives if no exact match is found. ```bash cherri --action=action_name ``` -------------------------------- ### Get Last Import Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/photos.md Retrieves the last imported set of photos. ```APIDOC ## Get Last Import ### Description Retrieves the last imported set of photos. ### Signature `getLastImport()` ``` -------------------------------- ### Get Shazam Detail Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/media.md Retrieves a specific detail about a Shazam result. ```APIDOC ## Get Shazam Detail ### Description Retrieves a specific detail about a Shazam result. ### Method getShazamDetail(variable input, shazamDetail detail) ### Enums #### shazamDetail - 'Apple Music ID' - 'Artist' - 'Title' - 'Is Explicit' - 'Lyrics Snippet' - 'Lyric Snippet Synced' - 'Artwork' - 'Video URL' - 'Shazam URL' - 'Apple Music URL' - 'Name' ``` -------------------------------- ### Output or Copy to Clipboard Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/basic.md Use `outputOrClipboard` to output text or copy it to the clipboard if no output destination is available. ```cherri outputOrClipboard(text output) ``` -------------------------------- ### Get Weather Detail Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/location.md Retrieves a specific detail about a weather forecast. ```APIDOC ## Get Weather Detail ### Description Get a detail about a weather forecast. ### Method ``` getWeatherDetail(variable weather, weatherDetail detail) ``` ### Parameters #### Path Parameters - **weather** (variable) - Required - The weather data object. - **detail** (weatherDetail) - Required - The specific weather detail to retrieve (e.g., 'Temperature', 'Humidity'). ### Enum: weatherDetail - 'Name' - 'Air Pollutants' - 'Air Quality Category' - 'Air Quality Index' - 'Sunset Time' - 'Sunrise Time' - 'UV Index' - 'Wind Direction' - 'Wind Speed' - 'Precipitation Chance' - 'Precipitation Amount' - 'Pressure' - 'Humidity' - 'Dewpoint' - 'Visibility' - 'Condition' - 'Feels Like' - 'Low' - 'High' - 'Temperature' - 'Location' - 'Date' ``` -------------------------------- ### Make Shortcut Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/shortcuts.md Creates a new shortcut with a specified name. Optionally, the shortcut can be set to open automatically upon creation. ```actions makeShortcut(text name, bool ?open = true) ``` -------------------------------- ### Open App Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/device.md Launches a specific application on the device, identified by its App ID. ```action openApp(text appID) ``` -------------------------------- ### Get Maps Link Source: https://github.com/electrikmilk/cherrilang.org/blob/main/language/standard/location.md Generates a link to a map for a given location. ```APIDOC ## Get Maps Link ### Description Get a link for a location. ### Method ``` getMapsLink(variable location) ``` ```