Tag: applescript

从NodeJS中执行exec osascript(AppleScript)

我知道我可能错过了这个巨大的, 但是有人知道为什么这会一直返回一个错误? $ node -v && node v0.4.6 > var cmd = 'osascript -e "open location \"http://google.com\""'; > require('child_process').exec(cmd, function (error, stdout, stderr) { console.log(error); }); //Error message > { stack: [Getter/Setter], arguments: undefined, type: undefined, message: 'Command failed: 15:20: syntax error: A “:” can't go after this identifier. (-2740)\n', killed: false, code: 1, signal: […]

Express中的查询参数被提取?

我正在为Node.JS编写一个AppleScript应用程序的API。 AppleScript应用程序以下面的forms运行在shell脚本中: do shell script ("cd " & quoted form of myDir & " curl http://localhost:5000/server.properties?some-value=true&next-value=something%20else&[…] -O") 它打算下载名为server.properties的文件到基于指定参数的内容的目录myDir ,但由于某种原因,当Express收到请求时,它显示只有当我运行console.log(res.originalUrl) : /server.properties?some-value=true 它将把这个请求视为没有其他参数被指定。 任何人都可以告诉我我做错了什么,或者如何找出错误的地方? 编辑原来是我运行shell脚本的方式。 该URL需要被引用,以便&在shell脚本中不作为操作符。