-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdsd-html-converter-contract
More file actions
53 lines (39 loc) · 1.51 KB
/
dsd-html-converter-contract
File metadata and controls
53 lines (39 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 13 15:19:08 2020
@author: user
DART 편집기를 열어서 HTML로 저장하는 코드.
스파이더 관리자 모드로 열어야 작동한다.
https://wotres.tistory.com/entry/python-%EC%97%90%EC%84%9C-SyntaxError-unicode-error-unicodeescape-codec-cant-decode-bytes-in-position-2-3-truncated-UXXXXXXXX-escape-%EC%97%90%EB%9F%AC-%ED%95%B4%EA%B2%B0%EB%B2%95
"""
import os
import glob
import pyautogui
import time
def mouse_click(x, y):
pyautogui.moveTo(x, y)
pyautogui.click()
time.sleep(0.5)
# 1. 작업 폴더로 변경
os.chdir(r"C:\Users\yoont\Desktop\업무\1. 제도\2. 설계\5. 외감 계약리스트 (21-01)\2. 계약체결보고\2021\입수 (2) 0432\\") # 작업 폴더로 변경o
# 2. 타겟 폴더에 있는 필요 문서 경로 리스트업
pathList = glob.glob('**/*.dsd')
resultPath = "C:\\Users\\yoont\\Desktop\\result\\"
# pathList = pathList[:49]
for path in pathList:
os.startfile(path)
time.sleep(6)
pyautogui.press('o')
time.sleep(1)
pyautogui.press('o')
time.sleep(1)
mouse_click(50, 50) # 파일
mouse_click(200, 600) # HTML로 저장 선택식
pyautogui.write(path.split("\\")[0])
mouse_click(1930, 490) # PATH 선택
pyautogui.write(resultPath) # 지정된 경로 입력
pyautogui.press('enter') # Enter키 입력
mouse_click(2200, 1290) # 저장 버튼
# mouse_click(2510, 15) # 다트 편집기 종료
mouse_click(50, 50)
pyautogui.press('x')