RunMacro Documentation
Learn RunMacro from basics to advanced.
Everything you need to start and master RunMacro — from basic commands to advanced automation workflows.

Package a macro and its resources as a portable PMacro project
In RunMacro Studio, save the root macro, use File › Check dependencies... as advisory evidence, then choose File › Package project.... The analyzer can falsely flag a current protected/app-key QMacro because it expects macro.json, even when the exporter can package it. Test the archive in a clean folder and remember that editable PMacro contents are readable as ZIP.
Prerequisites
- Studio must contain at least one workflow command; an empty project cannot be packaged.
- Save the root PMacro and its editable children first so relative paths have the correct owning-directory base.
- Referenced PMacro/QMacro files, Find Image assets and selector profiles must exist and be readable.
- An app-key QMacro child can be repackaged, but a password-protected child QMacro cannot be recursively embedded.
- The destination must be writable and have room for the archive and any overwrite backup.
- Remove credentials, cookies and private data from commands and metadata before giving the package to anyone.
Supported modes
- Desktop Mode — Packaging is a Studio action available while the workspace is in Desktop Mode. The archive preserves mode metadata; it does not translate Desktop commands into Browser commands.
- Browser Mode — Studio can package a Browser Mode workflow. Commands, used selectors and images travel, but Chrome profiles, cookies, provider applications, local APIs and browser state remain external prerequisites.
What it does
Package Project writes an editable .pmacro archive. Inside are readable macro.json data, manifests, used selector profiles, images and a submacros/ tree when required. RunMacro follows PMacro calls, QMacro calls, Window Watcher run-macro handlers and Find Image assets recursively, copies each resolvable dependency under a collision-resistant package name, and rewrites the packaged command references. The open source workflow remains untouched. An ordinary PMacro save keeps child macros external; both Project packaging and QMacro export recurse, but only QMacro seals command and resource bytes in an encrypted payload.
When to use it
- Move a workflow with nested child macros and images to another computer without copying every dependency by hand.
- Hand an editable Studio project to a collaborator instead of distributing a runner-oriented QMacro.
- Create and clean-test an intended self-contained archive of a PMacro/QMacro tree before archiving or support handoff.
- Consolidate resources from several folders into one archive whose packaged references point internally.
When not to use it
- Confidential logic, credentials or customer data must remain secret; a Project package provides no encryption boundary.
- The deliverable should open as a controlled QMacro Runner experience with metadata, inputs, Safe Mode or a password; use Export QMacro instead.
- Dependencies are produced by custom code or dynamic data rather than recognized command fields; automatic discovery cannot cover arbitrary runtime files.
- Several authors need merging, version history or live updates; this package is a snapshot, not source control or Cloud Sync.
Configuration steps
- Open the root workflow in RunMacro Studio, test it, and save it to disk. Save editable child macros too so every relative reference has a stable owner directory.
- Choose File › Check dependencies... to inspect recognized fields, but treat the report as advisory: the analyzer currently expects
macro.jsonand cannot reliably inspect a protected/app-key QMacro. - Resolve real missing files, cycles, over-deep chains, and password-protected child QMacros. If an app-key child is flagged only for missing
macro.json, record the possible false positive and rely on exporter behavior plus clean-folder testing. - Choose File › Package project.... This is separate from Export as QMacro... and there is no protection or run-configuration dialog.
- In Save As, select a destination and filename. Studio proposes
workflow-project.pmacroor<current-name>-project.pmacro, starts in Downloads and appends.pmacrowhen needed. - Read the export preflight. Choose No for a genuinely missing item; a protected/app-key QMacro reported only as lacking
macro.jsoncan be a false positive even when the exporter packages it. If you continue, test with the old source unavailable. - RunMacro recursively copies resolvable children, assigns collision-resistant names under
submacros/andimages/, records resource hashes, and rewrites only the packaged copies. - Wait for the success message. An existing destination is replaced atomically and its previous bytes are copied to a neighboring
.bakfile; the open Studio document remains the source document. - Move the result to a clean test folder, make the originals unavailable, open the package in Studio and exercise every branch. After editing a received project, run Package Project again rather than relying on ordinary Save.
Every option explained
Expected result
The result is one editable .pmacro archive containing readable macro.json and macro_manifest.json, plus selector_library.json, images/ and submacros/ when used. Recognized references target embedded resources, allowing the tested dependency tree to run without the originals. The archive does not replace the open Studio document and is not encrypted.
Real example
Example: move a three-level workflow with images to another PC
- Save
main.pmacro,login.pmacroandreport.pmacro; let each child use a relative reference to the next level and confirm the Find Image asset exists. - Open
main.pmacro, run Check dependencies..., fix real missing items, and recognize that a protected/app-key QMacromacro.jsonerror can be a false positive. - Choose Package project..., save
report-project.pmacro, and wait for the embedded-submacro confirmation. - Copy only the resulting archive to a clean machine or folder, then make the three originals unavailable.
- Open the project in Studio and execute the login, image and report branches before delivering it with any external environment requirements.
Example: revise a received project without losing portability
- Open the received
inventory-project.pmacroin Studio and confirm that its embedded child calls execute. - Edit the root or an extracted child and test every affected branch during that session.
- Do not treat ordinary File › Save as the final portable deliverable because it disables child embedding and may retain extraction-directory references.
- Choose File › Package project... and produce
inventory-project-v2.pmacrorather than immediately overwriting the received copy. - Close Studio, move v2 into a clean folder, reopen it and retest before returning the revision.
Limitations and failure cases
- An editable PMacro project is plaintext. Opening it as ZIP exposes
macro.json, selectors, metadata, paths and images; it is not source protection or a credential vault. - A missing dependency is skipped while its original command path remains. Because the warning can be overridden, a successful write does not prove that every runtime branch is self-contained.
- Dependency cycles abort the export without a partial destination, and recursive packaging has a hard ceiling of 10 nested levels.
- The normal preflight report scans only five levels by default, so a deeper problem can survive Check Dependencies and fail during archive construction.
- Check Dependencies cannot reliably read a current protected/app-key QMacro because its analyzer requires
macro.json. This can be a false positive while the exporter successfully decrypts and packages that child, so the report does not reliably cover every dependency type the exporter supports. - A nested PMacro opened from a package can have relative references resolved from a temporary extraction directory. The exporter may still remap and package it correctly, so a temporary preflight path alone proves neither failure nor portability.
- A password-protected child QMacro cannot be nested because no child password is available to the exporter. App-key QMacro children can be opened and repackaged by the application.
- Relative references in an unsaved workflow have an unstable base: preflight uses a synthetic current-directory owner while packaging can resolve against the selected output path.
- Discovery covers recognized Run Macro, Run QMacro, Window Watcher, Find Image and selector fields. Files opened dynamically by Python, code commands or data values are outside that graph.
- Child files are remapped to temporary extraction paths when a project is opened. A plain Save after editing can lose self-containment; package the revision again.
- Chrome profiles, cookies, provider software, local APIs, fonts, Python modules, licenses, administrator rights, environment variables and network services are not bundled.
- Archive validation allows at most 500 entries, 200 MiB total uncompressed data and 50 MiB per member; traversal paths, symlinks, unknown files and case-insensitive collisions are rejected.
Tips & common mistakes
.zip and inspect it exactly as a recipient can. Do not distribute the archive while tokens, passwords or customer data remain.-v2 archive with Package Project and test it in a clean folder. Do not merely Save and return the open file.Verification details
storage/json_store.pycore/macro_path.pycore/macro_dependency_analyzer.pytests/test_project_package.pytests/test_phase_b_package.py
RunMacro