Skip to main content
TapKit can trigger iOS Shortcuts, enabling powerful custom automation workflows.

Basic Usage

Run a shortcut by name:
phone.run_shortcut(name="My Shortcut")
Or by index (0-based position in the Shortcuts app):
phone.run_shortcut(index=0)  # First shortcut

Parameters

ParameterTypeDescription
namestr | NoneShortcut name
indexint | NoneShortcut position (0-based)
Provide either name or index, not both.

Examples

Run by Name

# Run a specific shortcut
phone.run_shortcut(name="Morning Routine")

Run by Index

# Run the first shortcut in your library
phone.run_shortcut(index=0)

# Run the third shortcut
phone.run_shortcut(index=2)

Shortcut Workflow

# Prepare device state
phone.home()
time.sleep(0.3)

# Run shortcut
phone.run_shortcut(name="Take Screenshot and Save")
time.sleep(2)  # Wait for shortcut to complete

# Continue with other actions
phone.open_app("Photos")

Useful Shortcut Ideas

Shortcuts can extend TapKit’s capabilities:

Copy Clipboard

Create a shortcut that copies clipboard contents to a file or sends it via API

Set System Settings

Toggle settings that aren’t directly accessible via TapKit

Send Notifications

Send custom notifications or alerts

Process Data

Transform data using Shortcuts’ built-in actions

Creating Compatible Shortcuts

For best results with TapKit:
  1. Make shortcuts silent - Avoid dialogs that require interaction
  2. Use timeouts - Add reasonable timeouts for network operations
  3. Handle errors - Use “Continue if Error” for robust execution
  4. Keep them focused - Single-purpose shortcuts are more reliable

Example: Silent Screenshot Shortcut

A shortcut that takes a screenshot and saves it without prompts:
  1. Take Screenshot
  2. Save to Photo Album (no confirmation)
  3. Stop and Output (nothing)

Tips

Open the Shortcuts app to see exact shortcut names. Names are case-sensitive.
Complex shortcuts take time. Add appropriate delays after running:
phone.run_shortcut(name="Complex Task")
time.sleep(5)  # Wait for completion
TapKit runs shortcuts without input parameters. If your shortcut needs input, consider:
  • Setting up the input beforehand (clipboard, files)
  • Creating a wrapper shortcut that fetches input
Check device state after running shortcuts to verify success:
phone.run_shortcut(name="My Shortcut")
time.sleep(2)

# Verify result via screenshot or other check
screenshot = phone.screenshot()

Next Steps