### Database Connection and Query Example in Python Source: https://help.claris.com/en/pro-help/content/set-data-file-position This Python snippet demonstrates how to establish a connection to a database and execute a query. It uses a placeholder for the database connection details and the SQL query. Ensure you have the appropriate database driver installed. ```python import database_connector # Assuming a library like psycopg2, mysql.connector, etc. def execute_query(db_config, query): connection = None try: # Establish database connection connection = database_connector.connect(**db_config) cursor = connection.cursor() # Execute the query cursor.execute(query) results = cursor.fetchall() return results except Exception as e: print(f"Error executing query: {e}") return None finally: if connection: connection.close() ``` -------------------------------- ### Installing from Requirements File (`pip install -r`) (Shell Command) Source: https://help.claris.com/en/pro-help/content/configure-local-notification This command installs all packages listed in a `requirements.txt` file. It's the standard way to set up a project's dependencies on a new system or in a fresh virtual environment. ```bash pip install -r requirements.txt ``` -------------------------------- ### Function: Get(InstalledFMPlugins) (FileMaker) Source: https://help.claris.com/en/pro-help/content/installing-plug-ins The Get(InstalledFMPlugins) function returns a list of installed plug-ins and their versions. This is useful for checking existing installations and determining if an update is necessary before reinstalling a plug-in. The output is a list of text. ```FileMaker Calculation Get(InstalledFMPlugins) ``` -------------------------------- ### Example: Get Info for All RAG Spaces Source: https://help.claris.com/en/pro-help/content/getragspaceinfo This example demonstrates calling the GetRAGSpaceInfo function to retrieve information about all RAG spaces associated with the 'customer-support-rag-account'. The output shows a list of spaces and their models. ```FileMaker Pro Scripting GetRAGSpaceInfo ( "customer-support-rag-account" ) ``` -------------------------------- ### Install OnTimer Script Example (FileMaker) Source: https://help.claris.com/en/pro-help/content/install-ontimer-script This code snippet demonstrates how to install an 'OnTimer' script that executes every 60 seconds. The 'Clock OnTimer' script is set to run the 'Clock' script, which updates a 'Time' field. ```FileMaker Install OnTimer Script ["Clock"; Interval: 60] ``` ```FileMaker Set Field [Clock::Time; Get ( CurrentTime )] ``` -------------------------------- ### Python: Fetching Data with Requests Source: https://help.claris.com/en/pro-help/content/scatter-bubble-charts Demonstrates how to fetch data from an API endpoint using the Python 'requests' library. This snippet shows a basic GET request and how to handle the JSON response. It requires the 'requests' library to be installed. ```python import requests url = "YOUR_API_ENDPOINT" headers = {"Authorization": "Bearer YOUR_API_KEY"} try: response = requests.get(url, headers=headers) response.raise_for_status() # Raise an exception for bad status codes data = response.json() print(data) except requests.exceptions.RequestException as e: print(f"Error fetching data: {e}") ``` -------------------------------- ### Function: Get(LastErrorDetail) (FileMaker) Source: https://help.claris.com/en/pro-help/content/installing-plug-ins The Get(LastErrorDetail) function returns a detailed error message if a plug-in fails to install. This function is crucial for troubleshooting installation problems, providing specific information about why the installation did not succeed. ```FileMaker Calculation Get(LastErrorDetail) ``` -------------------------------- ### Installing Packages with Pip (Shell Command) Source: https://help.claris.com/en/pro-help/content/configure-local-notification This command installs a Python package (e.g., 'requests') into the currently active Python environment using pip, the Python package installer. It's typically run after activating a virtual environment. ```bash pip install requests ``` -------------------------------- ### Get Installed FM Plugins Information Source: https://help.claris.com/en/pro-help/content/get-installedfmplugins Retrieves the name, version, and enabled state of installed plug-ins in FileMaker Pro. The output is text, with each plug-in's details on a new line. Version information is only returned if provided by the plug-in developer. The enabled state can be 'Enabled', 'Disabled', or 'Ignored'. ```filemaker Get ( InstalledFMPlugins ) ``` -------------------------------- ### JavaScript Fetch API Example Source: https://help.claris.com/en/pro-help/content/generate-response-from-model This JavaScript snippet demonstrates how to make an HTTP GET request using the `fetch` API. It fetches data from a specified URL and processes the JSON response. This is commonly used for interacting with web APIs. ```javascript async function fetchData(url) { try { const response = await fetch(url); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } const data = await response.json(); console.log(data); return data; } catch (error) { console.error('Error fetching data:', error); } } // Example usage: // fetchData('https://api.example.com/data'); ``` -------------------------------- ### Script Step: Install Plug-In File (FileMaker) Source: https://help.claris.com/en/pro-help/content/installing-plug-ins The 'Install Plug-In File' script step is used to install a plug-in from a specified container field. This is a key step in automating the plug-in installation process within FileMaker Pro. It requires the plug-in data to be present in a container field. ```FileMaker Script Install Plug-In File [ Specify container field: "MyPluginContainer" ] ``` -------------------------------- ### Perform AppleScript: Install Network Printer (macOS) Source: https://help.claris.com/en/pro-help/content/perform-applescript-os-x This example illustrates using the Perform AppleScript script step to execute a shell command for installing a network printer. It dynamically constructs the command using FileMaker Pro fields for printer name, IP address, and driver details, properly escaping characters. ```FileMaker Pro Perform AppleScript ["do shell script \"lpadmin -p \" & Printers::Name & \" -E -v lpd://\" & Printers::IP Address & \" -P /Library/Printers/PPDs/Contents/Resources/\" & Substitute ( Printers::Driver Name ; \" \" ; \\\\ \" ) & \".gz -D \\\"\" & Printers::Description & \\\"\"\""] ``` -------------------------------- ### Handle Unsupported Script Steps with Get(LastError) Source: https://help.claris.com/en/pro-help/content/running-scripts-on-server This script demonstrates how to handle unsupported script steps when running on FileMaker Server or Cloud. It uses the Get(LastError) function to check for errors after a script step and provides an alternative action if the step is unsupported. The Open File script step is used as an example of an unsupported step. ```fmp Open File [Open hidden: Off ; "Invoices Backup"] If [ Get(LastError) = 3 ] Exit Script [ Text Result: "unsupported" ] End If ``` -------------------------------- ### Configuration Example in YAML Source: https://help.claris.com/en/pro-help/content/report-considerations A sample YAML configuration file structure, illustrating key-value pairs and nested structures. ```yaml database: adapter: postgresql host: localhost username: admin password: secure: true value: "********" ``` -------------------------------- ### Get Number of Installed Plugins - FileMaker Calculation Source: https://help.claris.com/en/pro-help/content/get-installedfmpluginsasjson This FileMaker calculation demonstrates how to determine the number of installed plug-ins by parsing the JSON output from Get(InstalledFMPluginsAsJSON). It uses ValueCount and JSONListKeys to count the elements in the 'plugins' array. ```FileMaker ValueCount ( JSONListKeys ( Get ( InstalledFMPluginsAsJSON ) ; "plugins" ) ) ``` -------------------------------- ### Listing Installed Packages (`pip list`) (Shell Command) Source: https://help.claris.com/en/pro-help/content/configure-local-notification This command lists all the Python packages installed in the current environment, along with their versions. It's useful for checking dependencies or troubleshooting. ```bash pip list ``` -------------------------------- ### FileMaker Data API GET Request Example Source: https://help.claris.com/en/pro-help/content/get-errorcapturestate Provides a cURL example for performing a GET request to the FileMaker Data API to retrieve records. This is fundamental for integrating FileMaker data into other systems. ```cURL curl -u "username:password" -X GET "https://your.server.com/fmi/data/v1/databases/your_database/layouts/your_layout/records" ``` -------------------------------- ### Creating a Simple Class and Object (Python) Source: https://help.claris.com/en/pro-help/content/configure-local-notification This Python example defines a simple class `Dog` with an initializer (`__init__`) and a method (`bark`). It then creates an instance (object) of this class and calls its method. This demonstrates fundamental object-oriented programming concepts in Python. ```python class Dog: def __init__(self, name, breed): self.name = name self.breed = breed def bark(self): return f"{self.name} says Woof!" # Create an instance of the Dog class my_dog = Dog("Buddy", "Golden Retriever") # Access attributes and call methods print(f"My dog's name is {my_dog.name} and it's a {my_dog.breed}.") print(my_dog.bark()) ``` -------------------------------- ### Creating a Simple Web Server in Node.js Source: https://help.claris.com/en/pro-help/content/quick-charts This Node.js snippet demonstrates how to create a basic HTTP server using the 'http' module. It listens for incoming requests and sends a 'Hello World!' response. This is a fundamental example for web development in Node.js. ```javascript const http = require('http'); const server = http.createServer((req, res) => { res.statusCode = 200; res.setHeader('Content-Type', 'text/plain'); res.end('Hello World!\n'); }); const port = 3000; server.listen(port, () => { console.log(`Server running at http://localhost:${port}/`); }); ``` -------------------------------- ### Example: Get Info for a Specific RAG Space Source: https://help.claris.com/en/pro-help/content/getragspaceinfo This example shows how to call GetRAGSpaceInfo to get details for a specific RAG space identified by 'knowledge-base' within the 'customer-support-rag-account'. The output includes space details and its content entries, like filenames and text chunks. ```FileMaker Pro Scripting GetRAGSpaceInfo ( "customer-support-rag-account" ; "knowledge-base" ) ``` -------------------------------- ### Get Installed FileMaker Plugins as JSON - FileMaker Source: https://help.claris.com/en/pro-help/content/get-installedfmpluginsasjson This function returns a JSON object detailing the attributes of all installed FileMaker plug-ins. It's useful for programmatic access to plug-in information, including name, version, ID, state, and file path. It originates from version 19.2.2 and returns text. ```FileMaker Get ( InstalledFMPluginsAsJSON ) ``` -------------------------------- ### Setting Up a Java Class Source: https://help.claris.com/en/pro-help/content/report-considerations Demonstrates the basic structure of a Java class with a constructor and a method. ```java public class MyClass { private String message; public MyClass(String msg) { this.message = msg; } public void printMessage() { System.out.println(message); } } ``` -------------------------------- ### Create a Simple HTTP Server in Python Source: https://help.claris.com/en/pro-help/content/get-networktype Provides a basic example of creating a simple HTTP server using Python's built-in `http.server` module. This is useful for quick local testing and serving static files. ```python import http.server import socketserver PORT = 8000 Handler = http.server.SimpleHTTPRequestHandler with socketserver.TCPServer(("", PORT), Handler) as httpd: print(f"Serving at port {PORT}") print(f"Open your browser to http://localhost:{PORT ``` -------------------------------- ### Creating Directories with `os.makedirs` (Python) Source: https://help.claris.com/en/pro-help/content/configure-local-notification This Python example demonstrates how to create directories, including any necessary parent directories, using `os.makedirs()`. This function is useful for setting up directory structures required by an application. ```python import os # Path for the new directory structure new_dir_path = "parent_dir/child_dir/grandchild_dir" # Create the directory structure try: os.makedirs(new_dir_path) print(f"Successfully created directory structure: {new_dir_path}") except FileExistsError: print(f"Directory structure '{new_dir_path}' already exists.") # Example of checking if it exists after creation if os.path.exists(new_dir_path): print(f"Verified: {new_dir_path} now exists.") ``` -------------------------------- ### Perform Script: No Parameters Source: https://help.claris.com/en/pro-help/content/script-examples This example demonstrates how to execute a script named 'Print Invoice Report' without passing any parameters. It first navigates to the 'Invoice Report' layout before performing the script. ```FileMaker Pro Go to Layout ["Invoice Report"] Perform Script [ Specified: From list ; "Print Invoice Report" ; Parameter: ] ``` -------------------------------- ### FileMaker Pro: Startup Script for Privilege Set Based Layout Source: https://help.claris.com/en/pro-help/content/script-examples This script is designed to run on startup, checking the user's privilege set. If the account has '[Full Access]', it directs the user to the 'Administration' layout; otherwise, it directs them to the 'Data Entry' layout, customizing the initial user experience. ```FileMaker Pro If [Get ( AccountPrivilegeSetName ) = "[Full Access]"] Go to Layout ["Administration"] Else Go to Layout ["Data Entry"] End If ``` -------------------------------- ### Get Trigger Panel Index and Name - FileMaker Pro Source: https://help.claris.com/en/pro-help/content/get-triggercurrentpanel The Get(TriggerCurrentPanel) function returns the index (starting from 1) and the object name of the panel that is being switched from when the OnPanelSwitch script trigger is activated. It returns 0 if the panel is invalid or the function is not used with the correct trigger. This function is often used in conjunction with Get(TriggerTargetPanel). ```FileMaker Pro Formula Get ( TriggerCurrentPanel ) ``` -------------------------------- ### Get Record Open State Function Example - FileMaker Pro Source: https://help.claris.com/en/pro-help/content/get-recordopenstate This example demonstrates the Get(RecordOpenState) function, which returns a numerical value indicating the current state of a record for the active user. The possible return values are 0 for a committed record, 1 for a new record not yet committed, 2 for a modified record not yet committed, and 3 for a deleted record not yet committed. This function is useful for tracking record status within a FileMaker Pro solution. ```FileMaker Pro Formula Get ( RecordOpenState ) ``` -------------------------------- ### FileMaker Pro: Startup Script for Device Detection Source: https://help.claris.com/en/pro-help/content/script-examples This script detects the version of FileMaker Pro or FileMaker Go that opened the database and directs the user to the appropriate 'Customers' layout based on the device. It differentiates between desktop, iPad, and iPhone versions. ```FileMaker Pro If [Get ( Device ) = 3] Go to Layout ["Customers iPad"] Else If [Get ( Device ) = 4] Go to Layout ["Customers iPhone"] Else Go to Layout ["Customers"] End If ``` -------------------------------- ### Create a Basic HTTP Server with Python Source: https://help.claris.com/en/pro-help/content/text-formatting-functions This Python snippet shows how to create a simple HTTP server. It uses the built-in `http.server` module to handle incoming requests and serve files from the current directory. This is useful for local development and testing. ```python import http.server import socketserver PORT = 8000 Handler = http.server.SimpleHTTPRequestHandler with socketserver.TCPServer(("", PORT), Handler) as httpd: print(f"Serving at port {PORT}") httpd.serve_forever() ``` -------------------------------- ### Claris Scripting: Function Example (Date Calculation) Source: https://help.claris.com/en/pro-help/content/changing-slide-control Provides an example of using built-in functions in Claris scripting, specifically for date calculations. This snippet shows how to get the current date and add days to it. ```Claris Script Set Variable [ $today ; Get(CurrentDate) ] Set Variable [ $futureDate ; Get(CurrentDate) + 7 ] # Calculates a date one week from today. ``` -------------------------------- ### Creating and Reading Text Files (Python) Source: https://help.claris.com/en/pro-help/content/configure-local-notification This Python example demonstrates the basic operations of creating a new text file, writing content to it, and then reading the content back. It utilizes the `with open(...)` statement for safe file handling, ensuring the file is closed automatically. ```python # Writing to a file file_path = "example.txt" content_to_write = "Hello, world!\nThis is a test file.\n" with open(file_path, "w") as file: file.write(content_to_write) print(f"Successfully wrote to {file_path}") # Reading from a file with open(file_path, "r") as file: read_content = file.read() print(f"Content read from {file_path}:") print(read_content) ``` -------------------------------- ### Configuration Loading with Python Source: https://help.claris.com/en/pro-help/content/general-preferences This Python snippet demonstrates loading configuration from a JSON file. It uses the 'json' module to parse the file content. Ensure the configuration file exists at the specified path and is valid JSON. ```python import json def load_config(config_path): try: with open(config_path, 'r') as f: config = json.load(f) return config except FileNotFoundError: print(f"Error: Configuration file not found at {config_path}") return None except json.JSONDecodeError: print(f"Error: Could not decode JSON from {config_path}") return None ``` -------------------------------- ### Get System Drive Information (FileMaker Pro) Source: https://help.claris.com/en/pro-help/content/get-systemdrive The Get(SystemDrive) function returns the drive letter on Windows or the volume name on macOS where the operating system is installed. This function is only supported within FileMaker Pro; other FileMaker products will return an empty string. It takes no parameters and returns text. ```FileMaker Pro Formula Get ( SystemDrive ) ``` -------------------------------- ### Count Open Data Files using ValueCount Source: https://help.claris.com/en/pro-help/content/get-opendatafileinfo This example demonstrates how to count the number of open data files by utilizing the ValueCount function on the output of Get(OpenDataFileInfo). The Get(OpenDataFileInfo) function returns a list of open files, and ValueCount then counts the number of items in that list, effectively giving the total number of open data files. ```FileMaker Pro ValueCount ( Get ( OpenDataFileInfo ) ) ``` -------------------------------- ### Open Sharing Script Step Example - FileMaker Pro Source: https://help.claris.com/en/pro-help/content/open-sharing This example demonstrates how to use the Open Sharing script step in FileMaker Pro. It first displays a custom dialog to confirm with the user if they wish to share the database. If the user confirms, the script proceeds to open the FileMaker Network Settings dialog box using the Open Sharing script step. This requires the user to have appropriate privilege sets or for the script to have full access privileges. ```FileMaker Pro Show Custom Dialog ["Do you want to share this database?"] If [Get ( LastMessageChoice ) = 1] Open Sharing End If ``` -------------------------------- ### Displaying Start of File (`head`) (Shell Command) Source: https://help.claris.com/en/pro-help/content/configure-local-notification This command displays the beginning (head) portion of a file. By default, it shows the first 10 lines, but the number of lines can be specified. ```bash head file_name.txt head -n 20 file_name.txt # Show first 20 lines ``` -------------------------------- ### Check for Specific Extended Privilege - FileMaker Calculation Example Source: https://help.claris.com/en/pro-help/content/get-currentextendedprivileges This FileMaker calculation demonstrates how to check if a specific extended privilege keyword exists within the list returned by Get(CurrentExtendedPrivileges). It uses the Position function to search for the 'fmwebdirect' keyword. ```FileMaker Calculation Position(Get(CurrentExtendedPrivileges); "fmwebdirect"; 1; 1) ``` -------------------------------- ### Get Folder Path and Set Field - FileMaker Script Source: https://help.claris.com/en/pro-help/content/get-directory This FileMaker script example demonstrates how to use the 'Get Folder Path' step to prompt the user for a folder selection, specifically targeting the 'Pictures' folder on the desktop. It then uses the 'Set Field' script step to store the obtained folder path into the 'Products::Pictures Folder' field. ```FileMaker Script Get Folder Path [$FOLDER; "Select the Pictures folder"; Get(DesktopPath)] Set Field [Products::Pictures Folder; $FOLDER] ``` -------------------------------- ### Open Upload to Host Script Step Example - FileMaker Pro Source: https://help.claris.com/en/pro-help/content/upload-to-server This example demonstrates how to use the Open Upload to Host script step. It first displays a custom dialog to confirm with the user if they want to upload a database to a host. If the user chooses to proceed, the Open Upload to Host dialog box is then presented. This functionality is specific to FileMaker Pro scripting. ```FileMaker Pro Show Custom Dialog ["Do you want to upload a database to a host?"] If [Get ( LastMessageChoice ) = 1] Open Upload to Host End If ``` -------------------------------- ### Get(ActiveSelectionStart) Function Source: https://help.claris.com/en/pro-help/content/get-activeselectionstart This function returns a number representing the starting character of the selected text. If no text is selected, it returns the cursor's current position. It is not supported in FileMaker WebDirect and may be inaccurate in concealed edit boxes in FileMaker Go. ```FileMaker Pro Formula Get ( ActiveSelectionStart ) ``` -------------------------------- ### Creating a Simple HTTP Server in Node.js Source: https://help.claris.com/en/pro-help/content/set-data-file-position This Node.js snippet shows how to create a basic HTTP server. It listens on a specified port and responds to requests with a simple message. This is useful for testing or simple API endpoints. ```javascript const http = require('http'); const hostname = '127.0.0.1'; const port = 3000; const server = http.createServer((req, res) => { res.statusCode = 200; res.setHeader('Content-Type', 'text/plain'); res.end('Hello, World!\n'); }); server.listen(port, hostname, () => { console.log(`Server running at http://${hostname}:${port}/`); }); ``` -------------------------------- ### Exporting Installed Packages (`pip freeze`) (Shell Command) Source: https://help.claris.com/en/pro-help/content/configure-local-notification This command outputs a list of installed Python packages in a format suitable for requirements files (e.g., `requirements.txt`). This allows easy recreation of the environment on other machines. ```bash pip freeze > requirements.txt ``` -------------------------------- ### Constructing Paths Safely (`os.path.join`) (Python) Source: https://help.claris.com/en/pro-help/content/configure-local-notification This Python example demonstrates the use of `os.path.join()` for constructing file paths. This method is platform-independent and correctly handles path separators for different operating systems (e.g., '/' for Linux/macOS, '\' for Windows). ```python import os folder = "data" filename = "report.csv" subfolder = "processed" # Constructing a path file_path = os.path.join(folder, filename) print(f"Simple path: {file_path}") # Constructing a nested path nested_path = os.path.join(folder, subfolder, filename) print(f"Nested path: {nested_path}") ``` -------------------------------- ### FileMaker Pro: Control Media Playback with External Events Source: https://help.claris.com/en/pro-help/content/get-triggerexternalevent This FileMaker Pro script example demonstrates how to use the Get(TriggerExternalEvent) function to control media playback. It checks for specific external events (like playing the next or previous media) and triggers corresponding actions. ```FileMaker Pro If [Get(TriggerExternalEvent) = 4 ] Go to Record/Request/Page [Next ; Exit after last: Off] AVPlayer Play [Object Name: "Player"] Else If [Get(TriggerExternalEvent) = 5 ] Go to Record/Request/Page [Previous ; Exit after last: Off] AVPlayer Play [Object Name: "Player"] End If ``` -------------------------------- ### Create and Remove Directories in Python Source: https://help.claris.com/en/pro-help/content/get-networktype Demonstrates how to create new directories and remove existing ones using Python's `os` module. This includes handling cases where the directory might already exist. ```python import os new_dir_path = "my_new_directory" # Create a directory try: os.mkdir(new_dir_path) print(f"Directory '{new_dir_path}' created successfully.") except FileExistsError: print(f"Directory '{new_dir_path}' already exists.") # Create a directory if it doesn't exist (safer) sub_dir_path = os.path.join(new_dir_path, "subdir") os.makedirs(sub_dir_path, exist_ok=True) print(f"Ensured directory '{sub_dir_path}' exists.") # Remove a directory (must be empty) try: os.rmdir(sub_dir_path) # Remove the subdirectory first print(f"Directory '{sub_dir_path}' removed successfully.") os.rmdir(new_dir_path) # Now remove the parent directory print(f"Directory '{new_dir_path}' removed successfully.") except OSError as e: print(f"Error removing directory: {e}") ``` -------------------------------- ### Get Folder Path with Loop for Export - FileMaker Script Source: https://help.claris.com/en/pro-help/content/get-directory This FileMaker script example showcases the 'Get Folder Path' step in conjunction with a loop for exporting files. It first performs a find operation, then prompts the user to select an export folder. Subsequently, it iterates through records, constructs a full file path by concatenating the selected folder path with the 'Products::Picture' field, and exports the field contents to the specified path. ```FileMaker Script Perform Find [Restore] Get Folder Path [Allow Folder Creation; $FOLDER; "Export to Folder"] Loop [ Flush: Always ] Set Variable [$PATH; Value:$FOLDER & Products::Picture] Export Field Contents [Products::Picture; $PATH ; Create folders: Off] Go to Record/Request/Page [Next; Exit after last: On] End Loop ``` -------------------------------- ### Modernizr initialization and feature detection Source: https://help.claris.com/en/pro-help/content/data-in-date-fields This snippet initializes Modernizr, adds prefixes for CSS properties, defines a test for `csspositionsticky`, and executes queued Modernizr tests. It also includes logic to load webp images based on browser support. It sets up Modernizr with necessary configurations and tests. ```javascript !function(e,n){function A(e){return e.charAt(0).toUpperCase()+e.slice(1)}function t(e,n){for(var A in e)if(e[A]in n)return e[A];return!1}function s(e){return"function"!=typeof window.matchMedia||window.matchMedia("(min-width:"+e+")").matches}function o(){var e=navigator.userAgent,n=/Mobile|mini|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e);f._isMobile=n}function i(e){var n="https://drwqngl9rhonr.cloudfront.net/",A=[{uri:"data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==",name:"webp.lossy"},{uri:"data:image/webp;base64,UklGRlIAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA",name:"webp.animation"},{uri:"data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=",name:"webp.lossless"}],A=n.shift();e(A.name,A.uri,function(A){if(A&&"load"===A.type)for(var t=0;t my_file.txt # Display the content of the file cat my_file.txt # Go back to the parent directory (optional) # cd .. ``` -------------------------------- ### Access Repeating Field Repetition using Array Operator - FileMaker Pro Source: https://help.claris.com/en/pro-help/content/contents-of-repetition This example demonstrates how to access a specific repetition of data within a repeating field using bracket notation, similar to array indexing. Ensure the field is defined as repeating and the index is within the range of existing repetitions. For example, `ParcelBids[2]` retrieves the second repetition. ```FileMaker Pro Calculation ParcelBids[2] ``` -------------------------------- ### Modernizr Feature Detection and Test Initialization Source: https://help.claris.com/en/pro-help/content/install-menu-set This JavaScript snippet initializes Modernizr, a feature detection library. It defines tests for various features, including 'csspositionsticky', and manages the asynchronous loading and execution of these tests. It also handles the prefixing for CSS properties. ```javascript var Modernizr = { _config: { usePrefixes: true }, _q: [], addTest: function() {}, addAsyncTest: function() {} }; (function(e, s) { var f = e.Modernizr; var r = s.documentElement; var n = { webp: { alpha: "data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==", animation: "data:image/webp;base64,UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA", lossless: "data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=" } }; var A = n.webp; var t = function(e, n, A) { var t; try { t = new Image(); t.onerror = t.onload = function() { if (!0) { if (t.width + t.height > 0) { i(n.name, !1); t.onerror = t.onload = null; } else { i(n.name, !0); } } else { i(n.name, t.width + t.height > 0); } }; t.src = n.uri; } catch (A) { if (!0) { i(n.name, void 0); } else { i(n.name, !1); } } }; e.WebPAnim = t; var a = [{ uri: "data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==", name: "webp.alpha" }, { uri: "data:image/webp;base64,UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA", name: "webp.animation" }, { uri: "data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=", name: "webp.lossless" }], d = a.shift(); e(d.name, d.uri, function(A) { if (A && "load" === A.type) for (var t = 0; t < a.length; t++) e(a[t].name, a[t].uri); }); var g = f._config.usePrefixes ? " -webkit- -moz- -o- -ms- ".split(" ") : ["", ""]; f._prefixes = g; Modernizr.addTest("csspositionsticky", function() { var e = "position:", n = "sticky", A = s("a"), t = A.style; return t.cssText = e + g.join(n + ";" + e).slice(0, -e.length), -1 !== t.position.indexOf(n) }); o(); i(r); delete f.addTest; delete f.addAsyncTest; for (var l = 0; l < Modernizr._q.length; l++) Modernizr._q[l](); e.Modernizr = Modernizr }(window, document)); ``` -------------------------------- ### Create New Records in FileMaker Using Scripts Source: https://help.claris.com/en/pro-help/content/textdecode This example shows how to script the creation of new records in FileMaker. It outlines the steps to initiate record creation, populate fields with data, and commit the new record. This is fundamental for data entry automation in FileMaker. ```FileMaker New Record/Request Set Field [YourTable::Field1; "Value1"] Set Field [YourTable::Field2; Get(CurrentDate)] Commit Records/Requests ``` -------------------------------- ### Get Container Attribute (Signature) Source: https://help.claris.com/en/pro-help/content/getcontainerattribute Retrieves signature-specific attributes from a container field named 'Package'. This example demonstrates how to obtain the 'Signed' timestamp. It is useful for verifying the time of signature capture in container fields. ```FileMaker Pro Calculation GetContainerAttribute(Package; "signature") ``` -------------------------------- ### Enable Network Sharing on Launch - FileMaker Pro Script Source: https://help.claris.com/en/pro-help/content/set-multi-user This script snippet demonstrates how to prompt the user to make a database available on the network upon launch using the Set Multi-User script step. It checks the user's choice before enabling network access. ```FileMaker Pro Show Custom Dialog ["Make this file available on the network?"] If [Get ( LastMessageChoice ) = 1] Set Multi-User [On] End If ``` -------------------------------- ### Defining a Function in C# Source: https://help.claris.com/en/pro-help/content/report-considerations This example shows the definition of a simple function in C#. The function takes an integer as input and returns an integer. ```csharp public int AddOne(int number) { return number + 1; } ```