Applescript 使用applscript执行挖掘并启动远程桌面

Applescript 使用applscript执行挖掘并启动远程桌面,applescript,Applescript,我不知道applescript,但我需要自动执行以下步骤,而applescript似乎是一种方法 1) 运行终端命令“dig@123.4.5.678 computername.domain.net+short” 2) 捕获返回的IP地址 3) 通过传入捕获的IP地址启动Microsoft远程桌面 这可能吗?我使用什么命令?有好的教程吗?要从Applescript运行shell脚本,请使用以下命令 执行shell脚本“mycommand” 其中mycommand是您正在执行的shell命令 Mic

我不知道applescript,但我需要自动执行以下步骤,而applescript似乎是一种方法

1) 运行终端命令“dig@123.4.5.678 computername.domain.net+short” 2) 捕获返回的IP地址 3) 通过传入捕获的IP地址启动Microsoft远程桌面


这可能吗?我使用什么命令?有好的教程吗?

要从Applescript运行shell脚本,请使用以下命令

执行shell脚本“mycommand”

其中mycommand是您正在执行的shell命令

Microsoft的远程桌面可能无法编写脚本。(我不使用它,也不能说)但是,您可以使用所谓的GUI脚本编写其他应用程序的脚本

然后,您可以有一个类似这样的脚本(注意:未测试)

GUI脚本基本上告诉RDC将剪贴板粘贴到IP的字段中

有关GUI脚本的教程可在以下位置找到:

这里有很多通用的Applescript教程,如:

set a to do shell script "myscript"
tell application "Finder" to set the clipboard to a
tell application "Remote Desktop Connection" to activate
tell application "System Events"
    tell process "Remote Desktop Connection" to keystroke "v" using command down
end tell