{"id":50977415,"url":"https://github.com/n0kovo/applescript-decompiler","last_synced_at":"2026-06-19T09:32:49.706Z","repository":{"id":363168246,"uuid":"1262121744","full_name":"n0kovo/applescript-decompiler","owner":"n0kovo","description":"A decompiler for compiled AppleScript (.scpt) files","archived":false,"fork":false,"pushed_at":"2026-06-07T17:37:11.000Z","size":137,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-07T19:17:35.299Z","etag":null,"topics":["applescript","decompiler","disassembler","reverse-engineering","scpt"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/n0kovo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-07T15:49:17.000Z","updated_at":"2026-06-07T17:38:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/n0kovo/applescript-decompiler","commit_stats":null,"previous_names":["n0kovo/applescript-decompiler"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/n0kovo/applescript-decompiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n0kovo%2Fapplescript-decompiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n0kovo%2Fapplescript-decompiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n0kovo%2Fapplescript-decompiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n0kovo%2Fapplescript-decompiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/n0kovo","download_url":"https://codeload.github.com/n0kovo/applescript-decompiler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n0kovo%2Fapplescript-decompiler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34526065,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["applescript","decompiler","disassembler","reverse-engineering","scpt"],"created_at":"2026-06-19T09:32:45.820Z","updated_at":"2026-06-19T09:32:49.686Z","avatar_url":"https://github.com/n0kovo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# applescript-decompiler\n\nDecompiler for compiled AppleScript (`.scpt`) files. Parses the `Fasd UAS`\nbinary format and reconstructs readable AppleScript source from the bytecode —\nincluding handlers, control flow (`if`/`repeat`/`try`/`tell` blocks), object\nspecifiers, and literals.\n\nBuilt on (and a significant extension of)\n[Jinmo/applescript-disassembler](https://github.com/Jinmo/applescript-disassembler).\n\n## Installation\n\n```sh\npip install applescript-decompiler\n```\n\nOr from a checkout:\n\n```sh\npip install .\n```\n\nRequires Python 3.11+.\n\n## Usage\n\n### Command line\n\n```sh\nasdec compiled.scpt\n```\n\n```\n========================================\nFunction: areaOfCircle\nArguments: none\n========================================\nif (not ({real, integer} contains class of var_0)) then\n    error \"Radius must be number.\"\nelse\nend if\nreturn ((var_0 * var_0) * |«class pi  »|)\n```\n\n### As a library\n\n```python\nfrom applescript_decompiler import decompile_file\n\nsource = decompile_file(\"compiled.scpt\")\nprint(source)\n```\n\n## How it works\n\n- `applescript_decompiler.fas` parses the `Fasd UAS` serialization format\n  (a port of the `FasLoad` routine from the original AppleScript runtime):\n  reference tables, value blocks, records, literals, and embedded bytecode.\n- `applescript_decompiler.opcodes` knows the 256-entry instruction set and\n  disassembles handler bytecode.\n- `applescript_decompiler.decompiler` interprets each handler's instructions\n  against a simulated value stack, emitting AppleScript statements as it goes.\n\n## Limitations\n\nDecompilation reconstructs source from bytecode, and some information is\ndiscarded at compile time or only meaningful with an application's\nterminology dictionary. Expect:\n\n- **Local variable names** are not stored in compiled scripts, so they appear\n  as `var_0`, `var_1`, … Handler argument names (including typed and\n  destructuring patterns), globals, and properties *are* recovered.\n- **Labeled parameters of application/scripting-addition commands** are not\n  reconstructed. A command's name is recovered (e.g. `make`, `display\n  dialog`), but its arguments are rendered positionally rather than with their\n  `with properties` / `given` labels.\n- **`use` statements, `property` initializers, and `script` object structure**\n  (inheritance, nesting) are not reconstructed; only the handlers they contain\n  are emitted.\n- **Output is per-handler**, framed with `=`/`Function:`/`Arguments:` headers,\n  not a single recompilable file. The handler bodies are valid AppleScript for\n  most inputs; pathological scripts can still leave a stray marker.\n\nA trailing `return` of the last expression is emitted for every handler (the\ncompiler stores it as the result), which is harmless but not always present in\nthe original.\n\n## Development\n\n```sh\nuv sync          # install dev dependencies\nuv run pytest    # run the test suite\n```\n\nThe test suite compiles a corpus of AppleScript sources with `osacompile`\n(macOS only) and verifies that decompilation round-trips: output must contain\nno unknown markers, balance its blocks, recompile cleanly, and leave no opcode\nunhandled.\n\n## License\n\nMIT — see [LICENSE](LICENSE). Original disassembler © 2017\n[Jinmo](https://github.com/Jinmo); decompiler extension © 2026\n[n0kovo](https://github.com/n0kovo).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn0kovo%2Fapplescript-decompiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn0kovo%2Fapplescript-decompiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn0kovo%2Fapplescript-decompiler/lists"}