问题描述
我已经在运行Mac OSX,并且想以编程方式操纵一个活动的RDP会话,例如,在该会话内的已启动程序中执行操作(特别是动态性,但知道通用方法不会受到伤害).
I've got Mac OSX running and want to programmatically manipulate a active RDP session to for instance, perform actions within a launched program within the session (dynamics specifically, yet woudn't hurt to know a universal way).
我不知道这是否可行.当前使用RDP文件通过凭据启动RDP会话,并具有通过NSWorkspace检索的我的活动会话的进程ID.这样,我可以做一些基本的事情,例如再次关闭会话,但我想操纵该会话.
I don't know if this is possible. Currently using a RDP file to launch the RDP session with credentials and have the process ID of my active session, retrieved via NSWorkspace. With that I can do the basic stuff like closing my session again, yet i want to manipulate the session.
我的RDP客户端当前是Microsoft远程桌面.
My RDP client currently is Microsoft Remote Desktop.
希望通过bash或python达到我的目标.
Would wish to reach my goal in either bash or python.
推荐答案
以下是一些建议:
- 在Python中使用
Quartz
图形库在RDP客户端窗口中进行操作.这是一个很好的开始:如何在Mac上的Python中列出所有工作区中的所有窗口? - 通过
ctypes
使用libfreerdp
. - 在 葡萄酒 下运行RDP会话,并使用诸如 AutoHotKey,AutoIT或
xdottool
.请参阅:如何以编程方式控制X11转发的应用程序? - 使用WinRM(
pywinrm
)代替RDP运行远程命令/脚本.检查此示例.这可以允许运行上述自动工具(例如,控制应用程序的AHK脚本). - 使用 Python GUI自动化库来模拟应用程序中的用户交互.
- 另请参见:针对Linux的GUI加密.
- 编写一个RDP客户端来转储屏幕像素.例如. WebRTC或使用libFreeRDP.
- 如果RDP客户端通过X11协议(Quartz)运行,则可以尝试根据此帖子来获取X11请求.
- 使用 FreeRDP 及其 API .其客户端与Linux,macOS和Windows兼容.
- Use
Quartz
graphics library in Python to manipulate with RDP client window. Here is a good start: How to list all windows from all workspaces in Python on Mac? - Use
libfreerdp
viactypes
. - Run RDP session under Wine and use tools such as AutoHotKey, AutoIT or
xdottool
. See: How to programmatically control X11 forwarded apps? - Use WinRM (
pywinrm
) instead of RDP to run remote commands/scripts. Check this example. This can allow to run auto tools mentioned above (e.g. AHK script controlling the apps). - Use Python GUI automation library for simulating user interaction in apps.
- See also: GUI scipting for Linux.
- Write an RDP client that dumps the pixels of the screen. E.g. WebRTC or using libFreeRDP.
- If RDP client runs via X11 protocol (Quartz), you can try to tap into X11 requests as per this post.
- Use FreeRDP and its API. Its client is compatible with Linux, macOS and Windows.
这篇关于以编程方式操纵活动的RDP会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!