app.plugin - Plugin Info

Query metadata about the current plugin.

Methods

app.plugin.id()

Get the unique identifier of the current plugin.

Returns: string

local id = app.plugin.id()
-- "com.example.myplugin"

app.plugin.name()

Get the display name of the current plugin.

Returns: string

local name = app.plugin.name()
-- "My Plugin"

app.plugin.version()

Get the version string of the current plugin.

Returns: string

local ver = app.plugin.version()
-- "1.2.3"

app.plugin.author()

Get the author of the current plugin.

Returns: string

local author = app.plugin.author()
-- "ByteAge"

app.plugin.description()

Get the description text of the current plugin.

Returns: string

local desc = app.plugin.description()
-- "A handy file processing plugin"

app.plugin.installPath()

Get the installation directory path of the current plugin.

Returns: string

local dir = app.plugin.installPath()
-- "/Users/alice/Library/Application Support/iRightMenu/Plugins/myplugin.rmx"

-- Read a resource file bundled with the plugin
local icon = app.path.join(dir, "icon.png")
local content = app.file.read(app.path.join(dir, "data.json"))

app.plugin.metadata()

Get the full metadata table of the current plugin.

Returns: table - all fields from plugin.json

local meta = app.plugin.metadata()
-- {
--   id = "com.example.myplugin",
--   name = "My Plugin",
--   version = "1.2.3",
--   author = "ByteAge",
--   description = "...",
--   minAppVersion = "2.0.0",
--   permissions = {"file", "shell"},
--   ...
-- }
app.log.info("Plugin version: " .. meta.version)

Description

  • L0 security module — available to all plugins without additional permissions
  • Replaces the implicit self:getName() and related methods on the Plugin base class
  • Replaces the deprecated _PLUGIN_DIR and _PLUGIN_METADATA global variables
  • app.plugin.installPath() returns the directory of the unpacked .rmx bundle; use it with app.path.join to access bundled resources

Examples

Reading Bundled Resources

function MyPlugin:onMenuItems(context)
    local dir = app.plugin.installPath()

    -- Load the plugin's built-in HTML template
    local templatePath = app.path.join(dir, "templates", "default.html")
    local template = app.file.read(templatePath)
    if not template then
        app.log.error("Template not found: " .. templatePath)
        return
    end

    -- Display in a WebView window
    app.webview.open({html = template, title = app.plugin.name()})
end

Logging Version Info

function MyPlugin:onMenuItems(context)
    local meta = app.plugin.metadata()
    app.log.info(string.format(
        "Plugin %s v%s (by %s) triggered",
        meta.name, meta.version, meta.author
    ))
end
Developer Documentation
User Guide
Getting Started Script Menus FAQ
Script Development
Development Guide
Plugin Development
Quick Start Development Guide Example Plugins
API Reference
Overview API Query Plugin Info Logging Finder Context Plugin Settings Internationalization
UI & Interaction
Dialog Progress Notification Chooser WebView Status Bar Dock
Files & Paths
File Operations Path Utilities Finder Actions Trash Extended Attributes Metadata File Watcher
Data Formats
JSON Plist CSV XML PDF Image
Text & Encoding
String Regex Date & Time Color Crypto
System
Shell Commands Process Application System Info AppleScript Shortcuts
System Info
Network Power/Battery Screen/Appearance Audio Bluetooth Location
Network
HTTP WebSocket URL
Input & Clipboard
Keyboard Mouse Hotkey Clipboard Window
Storage
SQLite Keychain UserDefaults
Media
OCR QR Code
Utilities
Archive UTI Share Timer Wake Lock Thread