evernote_evan 0 Posted June 12, 2023 Share Posted June 12, 2023 原来用 evernote,最近准备转到 obsidian,网上查到用 joplin 批量把 enex 文件转成 md 文件.目前遇到一个问题,有二百多个加密过的文件,查了一下没办法批量解密, 目前只能手动一个个点击解密 我通过 chatgpt 用 python 脚本写了一个自动点击操作的代码,需要如何修改达到循环遍历每一条笔记的自动操作? import pyautogui import time import ctypes # 设置鼠标移动和点击的延迟时间,根据需要进行调整 pyautogui.PAUSE = 0.5 # 打开 Evernote 应用程序(需要根据您的操作系统和应用程序位置进行调整) pyautogui.press('win') # 模拟按下 Windows 键 pyautogui.typewrite('Evernote Legacy.exe') # 输入 Evernote 应用程序的名称 pyautogui.press('enter') # 模拟按下回车键 # 等待 Evernote 打开 time.sleep(5) # 移动鼠标到 Evernote 笔记列表的位置并点击 # 这里需要根据您的屏幕分辨率和 Evernote 窗口大小进行调整 note_list_x = 300 note_list_y = 200 pyautogui.moveTo(note_list_x, note_list_y) pyautogui.click() # 循环处理所有笔记 while True: # 移动鼠标到笔记内容区域并点击 note_content_x = 500 note_content_y = 400 pyautogui.moveTo(note_content_x, note_content_y) pyautogui.click() # 等待笔记内容加载完成 time.sleep(2) # 判断是否有加密按钮,如果没有则认为笔记已取消加密 encrypt_button_pos = pyautogui.locateOnScreen('encrypt_button.png') if encrypt_button_pos is None: print("未找到加密按钮") # 进行相关处理或跳出循环 break # 移动鼠标到加密按钮位置 encrypt_button_x = encrypt_button_pos.left + encrypt_button_pos.width / 2 encrypt_button_y = encrypt_button_pos.top + encrypt_button_pos.height / 2 pyautogui.moveTo(encrypt_button_x, encrypt_button_y) # 右键点击加密按钮并选择"永久解密文件" ctypes.windll.user32.mouse_event(0x0008, 0, 0, 0, 0) # 模拟按下右键 ctypes.windll.user32.mouse_event(0x0010, 0, 0, 0, 0) # 模拟释放右键 pyautogui.typewrite(['down', 'down', 'enter']) # 使用键盘模拟向下键和回车键选择"永久解密文件" # 等待解密完成 time.sleep(2) # 输出取消加密完成的提示信息 print("已取消所有笔记的加密") Link to comment
Level 5 PinkElephant 8,852 Posted June 12, 2023 Level 5 Share Posted June 12, 2023 The forum is user 2 user, and the vast majority of us are no coders. You may get lucky if you re-post your post in an English translation. No guarantees however ... Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now