{"id":21602598,"url":"https://github.com/ff6347/extendscript-call-system","last_synced_at":"2025-03-18T13:25:00.440Z","repository":{"id":137796738,"uuid":"87931813","full_name":"ff6347/extendscript-call-system","owner":"ff6347","description":"explore how to download files and data from the web with extendscript on Windows and macOS","archived":false,"fork":false,"pushed_at":"2024-03-02T14:31:03.000Z","size":48,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-24T18:35:24.037Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ff6347.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}},"created_at":"2017-04-11T12:32:50.000Z","updated_at":"2023-08-27T05:30:28.000Z","dependencies_parsed_at":"2024-11-24T19:13:56.423Z","dependency_job_id":null,"html_url":"https://github.com/ff6347/extendscript-call-system","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ff6347%2Fextendscript-call-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ff6347%2Fextendscript-call-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ff6347%2Fextendscript-call-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ff6347%2Fextendscript-call-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ff6347","download_url":"https://codeload.github.com/ff6347/extendscript-call-system/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244229177,"owners_count":20419585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-24T19:13:53.195Z","updated_at":"2025-03-18T13:25:00.410Z","avatar_url":"https://github.com/ff6347.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Extendscript Call System\n========================\n\nExploration on how to call system commands from extendscript. Mainly for InDesign. \n\n----\n\nDear all. I think this was already discussed several times but I can't find any good example around the web. How do you execute system commands on windows? On macOS we use (in Basil.js) these snippets:  \n\nSnippet 1:  \n\n    var cmd = \"pwd\";\n    app.doScript(\"return do shell script item 1 of arguments\", ScriptLanguage.applescriptLanguage, [cmd]); \n\nAnd to make a call to an URL over HTTP/s this one:  \n\nSnippet 2:  \n\n    var url = \"https://api.github.com/orgs/basiljs/repos\"\n    var cmd = \"curl -m 15 -L '\" + url + \"'\";\n    app.doScript(\"return do shell script item 1 of arguments\", ScriptLanguage.applescriptLanguage, [cmd]);\n\nLast this is our call to download a file from the web.  \n\nSnippet 3 (shell script):  \n\n    #!/bin/bash\n    mkdir -p \"$1\"\n    cd \"$1\"\n    if [ -z \"$3\" ]\n      then\n        curl -L -O \"$2\"\n      else\n        curl -L -o \"$3\" \"$2\"\n    fi\n\n\n\nSnippet 4 (extendscript):  \n\n    var url = 'http://fabianmoronzirfas.me/assets/images/avatar/avatar-0.JPG';\n    var cmd = 'sh /Users/icke/tmp/download/download.sh /Users/icke/tmp/download/bin/ ' + url;\n    app.doScript('return do shell script item 1 of arguments', ScriptLanguage.applescriptLanguage, [cmd]);\n\n\nHas anybody an equivalent for snippet 1 + 4 for windows?","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fff6347%2Fextendscript-call-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fff6347%2Fextendscript-call-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fff6347%2Fextendscript-call-system/lists"}