Specialized Tools Shortcuts
1. API Integrator
What It Does
Connects to various APIs (Application Programming Interfaces) to fetch data or trigger actions from different online services. For example, retrieving weather data from a weather API or sending data to a project management tool.
How to Create It
Example: Fetch Current Weather Data from OpenWeatherMap API
Prerequisites:
- API Key: Sign up at OpenWeatherMap to obtain an API key.
- Shortcuts App: Ensure you have the Shortcuts app installed on your iPhone or iPad.
Steps:
- Open the Shortcuts App:
- Launch the Shortcuts app on your device.
- Create a New Shortcut:
- Tap the + icon in the top-right corner to create a new shortcut.
- Set Up the API Request:
- Choose “URL”:
- Search for and select the URL action.
- Enter the API endpoint. For OpenWeatherMap, it might look like:
https://api.openweathermap.org/data/2.5/weather?q=London&appid=YOUR_API_KEY&units=metric
- Replace
London
with a variable or ask for input if you want dynamic cities. - Replace
YOUR_API_KEY
with your actual API key.
- Choose “URL”:
- Get Contents of URL:
- Tap the + below the URL action.
- Search for Get Contents of URL and select it.
- Ensure the method is set to GET.
- Parse the JSON Response:
- Tap the + and search for Get Dictionary Value.
- Select Get Dictionary Value to extract specific data (e.g., temperature).
- For temperature: Set the key path to
main.temp
.
- Display the Result:
- Tap the + and add Show Result or Speak Text.
- If using Show Result, it will display the temperature.
- If using Speak Text, Siri will read out the temperature.
- Name and Save the Shortcut:
- Tap the Settings icon (three dots) at the top.
- Enter a name like “Fetch Weather”.
- (Optional) Tap Add to Home Screen for quick access.
How to Use It:
- Run the Shortcut: Tap it from the Shortcuts app or your Home Screen.
- Dynamic Input (Optional): Modify the shortcut to Ask for Input if you want to specify different cities each time.
2. Script Runner
What It Does
Executes custom scripts for advanced automation and system tweaks. This is particularly useful for developers or power users who want to run shell scripts, JavaScript, or other code snippets directly from their device.
How to Create It
Example: Run a JavaScript in Safari
- Open the Shortcuts App:
- Launch Shortcuts on your device.
- Create a New Shortcut:
- Tap the + icon.
- Tap Add Action.
- Set Up the Script Execution:
- Choose “Run JavaScript on Web Page”:
- Search for Run JavaScript on Web Page and select it.
- Note: This action works within Safari when sharing a webpage to the shortcut.
- Choose “Run JavaScript on Web Page”:
- Write Your JavaScript:
- Enter your JavaScript code in the provided field.
- Example: To change the background color of a webpage:
document.body.style.backgroundColor = "lightblue";
- Display or Share the Result:
- Add Show Result or Quick Look to view the output if your script generates output.
- Name and Save the Shortcut:
- Tap the Settings icon (three dots).
- Name it something like “Run JS”.
- Tap Done.
How to Use It:
- From Safari:
- Open a webpage.
- Tap the Share button.
- Select Shortcuts and choose “Run JS”.
- Customize:
- Modify the JavaScript to perform different actions as needed.
3. Data Parser
What It Does
Extracts and formats data from text, JSON, or XML sources efficiently. Ideal for processing data from APIs, files, or user input.
How to Create It
Example: Parse JSON Data from an API Response
- Open the Shortcuts App:
- Launch Shortcuts on your device.
- Create a New Shortcut:
- Tap the + icon.
- Tap Add Action.
- Fetch Data from API:
- Choose “Get Contents of URL”:
- Search for Get Contents of URL and select it.
- Enter the API endpoint (e.g., a JSON placeholder API).
- Choose “Get Contents of URL”:
- Parse the JSON:
- Tap the + and search for Get Dictionary Value.
- Select Get Dictionary Value.
- Set the key path to the data you want to extract.
- Example: To get a user’s name from JSON:
- Key path:
name
- Format the Data:
- Add Text or Combine Text to format the extracted data.
- Example:
User Name: [Get Dictionary Value]
- Display the Parsed Data:
- Add Show Result or Speak Text to view or hear the formatted data.
- Name and Save the Shortcut:
- Tap the Settings icon (three dots).
- Name it something like “Parse JSON”.
- Tap Done.
How to Use It:
- Run the Shortcut: Tap it to fetch, parse, and display the data.
- Customization: Adjust the key paths and formatting based on the JSON structure you’re working with.
4. Additional Specialized Shortcuts
- File Converter
What It Does: Converts files from one format to another, such as images to PDFs or text files to Word documents.
How to Create It
Example: Convert Image to PDF
- Open the Shortcuts App:
- Launch Shortcuts on your device.
- Create a New Shortcut:
- Tap the + icon.
- Tap Add Action.
- Select Images:
- Search for Select Photos and add it.
- Enable Select Multiple if you want to convert multiple images at once.
- Make PDF:
- Tap the + below and search for Make PDF.
- This action will convert the selected images into a PDF document.
- Save or Share the PDF:
- Add Save File to store the PDF in iCloud Drive or Share to send it via email or other apps.
- Name and Save the Shortcut:
- Tap the Settings icon.
- Name it “Image to PDF”.
- Tap Done.
How to Use It:
- Run the Shortcut: Select images when prompted, and the shortcut will create and save/share the PDF.
- Open the Shortcuts App:
- Automated Backup
What It Does: Automatically backs up important data like photos, contacts, or files to a cloud service or external drive.
How to Create It
Example: Backup Photos to iCloud Drive
- Open the Shortcuts App:
- Launch Shortcuts on your device.
- Create a New Shortcut:
- Tap the + icon.
- Tap Add Action.
- Select Photos:
- Search for Select Photos and add it.
- Enable Select Multiple.
- Save to iCloud Drive:
- Tap the + below and search for Save File.
- Choose iCloud Drive and specify the folder where you want to back up the photos.
- Add Notification (Optional):
- Add Show Notification to confirm backup completion.
- Name and Save the Shortcut:
- Tap the Settings icon.
- Name it “Backup Photos”.
- Tap Done.
How to Use It:
- Run the Shortcut: Select the photos you want to back up, and they’ll be saved to your specified iCloud Drive folder.
- Open the Shortcuts App:
5. Using & Managing the Shortcuts
- Add to Home Screen:
- Open the Shortcuts app and go to My Shortcuts.
- Tap the … (ellipsis) on the shortcut you want to add.
- Tap the Share icon at the bottom.
- Select Add to Home Screen.
- Customize the icon and name if desired, then tap Add.
- Use with Siri:
- Name Your Shortcut Clearly: Choose a simple and distinct name.
- Activate with Siri: Say “Hey Siri, [Shortcut Name]” to run the shortcut.
- Example: “Hey Siri, Fetch Weather”
- Set Up Automations:
- Open the Shortcuts app and tap Automation at the bottom.
- Tap the + icon to create a new automation.
- Choose a trigger (e.g., time of day, arriving at a location, connecting to Wi-Fi/Bluetooth).
- Select the shortcut you want to run automatically.
- Follow the prompts to customize and enable the automation.
6. Tips & Cautions
- API Integrator:
- Always secure your API keys. Consider using variables or asking for input to keep them hidden.
- Script Runner:
- Test your scripts thoroughly to avoid unexpected behavior.
- Data Parser:
- Understand the structure of your data sources to accurately extract information.
- File Converter & Automated Backup:
- Ensure you have sufficient storage in your chosen destination (iCloud, local drive).
- Regularly update your shortcuts to accommodate any changes in APIs or file formats.
- General Tips:
- Grant necessary permissions when prompted to ensure shortcuts run smoothly.
- Keep your Shortcuts app updated to access the latest features and actions.
- Organize your shortcuts into folders for easier management.
7. Final Wrap-Up
The **API Integrator**, **Script Runner**, and **Data Parser** shortcuts empower you to connect with various online services, execute custom scripts, and efficiently handle data. Additionally, shortcuts like **File Converter** and **Automated Backup** enhance your file management and data security. By leveraging these specialized tools, you can significantly streamline your workflows and automate complex tasks on your iOS devices. Remember to **customize**, **test**, and **organize** your shortcuts to maximize their effectiveness and ensure they align with your specific needs. Enjoy a more powerful and personalized iOS experience!