首页 > 其他分享 >[1038] Move the Adobe Acrobat to the left screen if it is in the right screen

[1038] Move the Adobe Acrobat to the left screen if it is in the right screen

时间:2024-07-22 13:06:56浏览次数:11  
标签:right Adobe arrow screen Key keyboard left

In python, it is difficult to capture it. But we can use another way to do this. Each time, when we open the Adobe Acrobat, it will show something like this:

If it is in the left screen, the blue arrow should be in the specific area. So we can use pyautogui.locateOnScreen to check if we can find the specific image in the area, if we can find and it means the windows is in the left screen. Otherwise it means the window is in the right screen, then we should move it to the left screen using the shortcut win + shift + left. The whole process can be implemented as follows:

pdf_arrow = os.path.join(root_dir, "Working\\GIS\\Data\\Models\\Automation\\Images", "pdf_arrow.png")

# Check if the Adobe Acrobat in the left window
try:
    button_pdf_arrow = pyautogui.locateOnScreen(pdf_arrow, confidence=0.8, region=(0, 100, 400, 100))
except:
    # move to the left
    keyboard = Controller()
    # Press the Windows key (also known as the meta key)
    keyboard.press(Key.cmd)
    keyboard.press(Key.shift)
    keyboard.press(Key.left)
    keyboard.release(Key.cmd)
    keyboard.release(Key.shift)
    keyboard.release(Key.left)
    # pyautogui.hotkey("win", "shift", "left")  # this doesn't work well
    time.sleep(0.5) 

 

标签:right,Adobe,arrow,screen,Key,keyboard,left
From: https://www.cnblogs.com/alex-bn-lee/p/18315816

相关文章

  • Adobe InCopy 2024 v19.5 (macOS, Windows) - 编写和副本编辑软件
    AdobeInCopy2024v19.5(macOS,Windows)-编写和副本编辑软件Acrobat、AfterEffects、Animate、Audition、Bridge、CharacterAnimator、Dimension、Dreamweaver、Illustrator、InCopy、InDesign、LightroomClassic、MediaEncoder、Photoshop、PremierePro、AdobeXD......
  • Adobe InDesign 2024 v19.5 (macOS, Windows) - 版面设计和桌面出版软件
    AdobeInDesign2024v19.5(macOS,Windows)-版面设计和桌面出版软件Acrobat、AfterEffects、Animate、Audition、Bridge、CharacterAnimator、Dimension、Dreamweaver、Illustrator、InCopy、InDesign、LightroomClassic、MediaEncoder、Photoshop、PremierePro、Adob......
  • Unity入门之重要组件和API(4) : Screen
    Screen类主要处理屏幕相关的操作。1.静态属性1.1常用属性【设备分辨率】Resolutionresolution=Screen.currentResolution;print("设备分辨率宽:"+resolution.width+"高:"+resolution.height);【屏幕窗口的宽高】这里得到的是当前窗口的宽高,不是设备分辨率的宽......
  • 最新2024视频剪辑Adobe全家桶AE,PR,PS软件等
    前言Adobe致力于为全球客户提供高品质、高性能的数字内容及相关服务,Adobe拥有卓越的产品、解决方案、服务和专业知识,帮助客户创造出与众不同、充满创意的产品和内容。Adobe拥有全球领先的数字化软件解决方案和行业知识产权(IP),为数字时代提供最具创新性、最高效的数字化创作工......
  • Clarke-Wright节约算法详解与Python代码示例
    Clarke-Wright节约算法详解与Python代码示例一、算法详解Clarke-Wright节约算法(简称C-W算法),也称为节约里程法或节约算法,是由Clarke和Wright于1964年提出的一种启发式算法。该算法主要用于解决车辆路径问题(VehicleRoutingProblem,VRP),特别是在运输车辆数目不确定的情况下......
  • SCREEN获取鼠标位置实现删除插入数据功能
     1、获取鼠标光标位置DATA:gv_lineTYPEi.gv_index=tc_material-top_line+gv_line-1.CLEAR:gs_tc_material_wa.READTABLEgt_tc_material_itabINDEXgv_indexINTOgs_tc_material_wa.2、点击删除按钮弹出确认提示框CALLFUNCTION'POPUP_TO_CONFIRM......
  • 网站被SmartScreen标记为不安全怎么办?
    在互联网时代,网站的安全性和可信度是用户选择是否继续访问的重要因素之一,然而,网站运营者偶尔会发现使用Edge浏览器访问网站时,会出现MicrosoftDefenderSmartScreen(以下简称SmartScreen)提示网站不安全的情况。为什么SmartScreen会提示网站不安全?作为网站运营者,网站被SmartScree......
  • 【Playwright+Python】手把手带你写一个自动化测试脚本
     如何使用代理方式打开网页 在playwright.chromium.launch()中传入proxy参数即可,示例代码如下:1、同步写法:fromplaywright.sync_apiimportsync_playwrightproxy={'server':'http:/127.0.0.1:8080'}defrun():withsync_playwright()asp:......
  • 【Shader】ComputeScreenPos 的使用
     在顶点着色器中使用ComputeScreenPos.使用tex2Dproj搭配screenPos来按屏幕uv采样屏幕材质(如_CameraDepthTexture和_CameraNormalTexture).ComputeScreenPos:接受的输入顶点在裁剪空间(经过MVPmatrix的变换)的位置将输出从  ---转自 ComputeSc......
  • 单机角色扮演游戏推荐:颂钟长鸣 Bellwright 中文安装包
    自从被诬陷谋杀王子并被王庭判处死刑后,您一直活在阴影之中。在侥幸的又一次逃过刺客的暗杀后,您发现了了一张刺客的合同,事情的走向开始变得扑朔迷离-您被诬陷仅仅是因为不幸吗?还是说背后有更大的阴谋?为了寻找答案,您决定结束背井离乡的生活并回来调查。您将逐步领导一场叛乱,反......