Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
试图检索我的 shell 命令的输出,所以我将它分配给一个变量并尝试通过 LogSuccess 命令记录它。
put shell ("cat login.txt") into myOutput LogSuccess myOutput
不幸的是,我在日志中看不到任何内容,或者无论如何都不知道该命令实际上已发送到 shell。有人知道我错过了什么吗?
当前的 eggPlant API 不返回shell()命令的输出。一个不错的解决方案是将命令的输出重定向到文件,然后立即读取。
shell()
set destinationFile to "~/tempfile" shell "cat login.txt > " & tempFile LogSuccess file destinationFile
上面的代码示例将向您显示命令的输出。