#include #include #include #include #include #include #include #include #include #include #include ;#include #include #Include ;#include <_sql.au3> #include #include "Process_CPUUsage.au3" Global $Paused HotKeySet("^`", "Terminate") Global $bHotKeyPressed=False Func _EscPressed() $bHotKeyPressed=True EndFunc Local $hSplash, $sSplashText Local $sProcess, $aProcUsage, $fUsage Local $aGraph, $hGUI, $iMax = 10,$s _Singleton("RBC") ;$WS_EX_ACCEPTFILES = 16 ;Local $guiArr[] = ['hGUI1','hGUI2','hGUI3','hGUI4','hGUI5'] ;_ArrayDisplay($guiArr,"guiarray") #Region ### START Koda GUI section ### Form=C:\Program Files\Koda 1.7.01\Forms\QuickFTP\FNTConvert.kxf $Form1 = GUICreate("Ai to Tiff", 241, 323, 202, 202, -1, $WS_EX_ACCEPTFILES) $Tab1 = GUICtrlCreateTab(6, 7, 228, 208) GUICtrlSetResizing(-1, $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT) $TabSheet1 = GUICtrlCreateTabItem("Convert") $Label1 = GUICtrlCreateLabel("Drop data here!", 51, 35, 119, 17) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetState(-1, $GUI_DROPACCEPTED) $Label3 = GUICtrlCreateLabel("Status: Waiting...", 71, 248, 85, 17) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) $Progress1 = GUICtrlCreateProgress(51, 271, 127, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) $Label5 = GUICtrlCreateList("", 10, 50, 160, 160);Label("1.)", 127, 160, 19, 17) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x808080) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) ;$process = GUICtrlCreateButton("Kill", 175, 150, 47, 20) ;GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) ;$TabSheet2 = GUICtrlCreateTabItem("About") ;$Label4 = GUICtrlCreateLabel("Developed by motionman95, 2009, All Rights Reserved.", 15, 286, 274, 17) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_DROPPED $s=$s+1 $File = @GUI_DragFile ;If StringRegExp($File, "^.+\.(?i)((txt)|(OTF))$") Then ;MsgBox(0, "", $File & @CRLF & "Is a font file.") GUICtrlSetData($Label5, $File, 1) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;$charsO = FileRead( $File) msgbox(0,"chr",$File,1) $pdf_in=$File&"\";;;;;;;;;;路徑1 ;$swop=("C:\adfs\swop\");; ;$swop=("P:\swop\");; $pdf_out=$File&"\ok\" DirCreate($pdf_out) $hold=$File&"\hold\" DirCreate($hold) $error=$File&"\error\" DirCreate($error) $rename=$File&"\ok\rename\" DirCreate($rename) $MyVar1=($pdf_in) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $pFileList11=_FileListToArray($MyVar1, '*.pdf',1) if not @Error=4 then $fa1=$pFileList11[0] Else $fa1=0 endif sleep(500) $pFileList21=_FileListToArray($MyVar1, '*.pdf',1) if not @Error=4 then $fb1=$pFileList21[0] Else $fb1=0 endif while $fa1<$fb1 $pFileList11=_FileListToArray($MyVar1, '*.pdf',1) $fa1=$pFileList11[0] sleep(500) $pFileList21=_FileListToArray($MyVar1, '*.pdf',1) $fb1=$pFileList21[0] wend sleep(500) $pFileList=_FileListToArray($MyVar1, '*.pdf',1) ;_ArraySort($FileList, 0, 1, 0, 0) ;_ArrayDisplay($FileList,"filelist") if not @Error=4 then $p=0 $i=1 Opt("WinTitleMatchMode", 2) Opt("MouseCoordMode",2) sleep(1000) for $j=1 to $pFileList[0] step 1 $rr1=($pdf_in&$pFileList[$j]) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $Dwidth='' $Dheight='' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $DwidthAR= _StringBetween($pFileList[$j], "_", "x") ;_ArrayDisplay($Dwidth, "wigth") if not @error=1 Then $Dwidth=$DwidthAR[0] ;$Dwidth=42 $by10=$Dwidth*10 msgbox(0,"",$by10,1) ;msgbox(0,"ibNumber",IsInt($by10)) if $by10==0 then msgbox(0,"2",$Dwidth,1) sleep(2000) filemove($rr1,$error) sleep(1000) ;msgbox(0,$rr1,$error) ;filemove($rr1,$error) ContinueLoop endif else $Dwidth='' endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $rr2=($pdf_out&$pFileList[$j]) $rr3=("C:\adfs\Xout\"&$pFileList[$j]) $pdfName=StringTrimRight($pFileList[$j],4) Filecopy($rr1,"C:\adfs\pTrans3\*.*") sleep(2000) $command = "python C:\Python33\PDFlib911\bind\python\PMpdfResizeC.py" Run($command, "", @SW_MAXIMIZE) sleep(2000) filemove($rr1,$hold&"*.*") sleep(1000) filedelete("C:\adfs\hold\*.*") sleep(1000) filemove("C:\adfs\Xout\*.*",$pdf_out&"*.*") sleep(1000) ;filemove($pdf_in&"*.pdf",$pdf_out&"*.*") sleep(2000) ;; 128 ai action loop sleep(500) msgbox(0,"","cycle",1) ;msgbox(0,"wait end",$rr1&","&$pdf_out&$rr2) ;FileDelete($rr1) sleep(1000) ;Filemove($rr1,"C:\adfs\hold\*.*") ;FileDelete($rr1) next ;;80 ;; 80 pstill for loop endif ;;71 ;;;odf if ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $FileList11=_FileListToArray($MyVar1, '*.ai',1) if not @Error=4 then $fa1=$FileList11[0] Else $fa1=0 endif sleep(500) $FileList21=_FileListToArray($MyVar1, '*.ai',1) if not @Error=4 then $fb1=$FileList21[0] Else $fb1=0 endif while $fa1<$fb1 $FileList11=_FileListToArray($MyVar1, '*.ai',1) $fa1=$FileList11[0] sleep(500) $FileList21=_FileListToArray($MyVar1, '*.ai',1) $fb1=$FileList21[0] wend sleep(500) $FileList=_FileListToArray($MyVar1, '*.ai',1) ;_ArraySort($FileList, 0, 1, 0, 0) ; _ArrayDisplay($FileList,"filelist") if not @Error=4 then $p=0 $i=1 Opt("WinTitleMatchMode", 2) Opt("MouseCoordMode",2) sleep(1000) for $j=1 to $FileList[0] step 1 $rr1=($pdf_in&$FileList[$j]) $aiName=StringTrimRight($FileList[$j],3) ;msgbox(0,"",$FileList[$j]) $Dwidth='' $Dheight='' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $DwidthAR= _StringBetween($FileList[$j], "_", "x") ;_ArrayDisplay($Dwidth, "wigth") if not @error=1 Then $Dwidth=$DwidthAR[0] ;$Dwidth=42 $by10=$Dwidth*10 msgbox(0,"",$by10,1) ;msgbox(0,"ibNumber",IsInt($by10)) if $by10==0 then msgbox(0,"2",$Dwidth,1) sleep(2000) filemove($rr1,$error) sleep(1000) ;msgbox(0,$rr1,$error) ;filemove($rr1,$error) ContinueLoop endif else $Dwidth='' endif $DheightAR= _StringBetween($FileList[$j], "x", "_") ;_ArrayDisplay($Dheight, "height") if not @error=1 Then $Dheight=$DheightAR[0] else $Dheight='' endif ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;msgbox(0,$Dwidth[0],$Dheight[0]) $size1=FileGetSize($rr1) msgbox(0,"wait for size",$size1 ,1) sleep(2000) $size2=FileGetSize($rr1) sleep(1000) msgbox(0,"wait for size",$size2 ,1) while $size1<>$size2 msgbox(0,"wait for size2",$size2 ,1) $size1=FileGetSize($rr1) sleep(5000) $size2=FileGetSize($rr1) sleep(500) wend winactivate("[TITLE:Adobe Illustrator CC 2018; CLASS:illustrator]", "") ;msgbox(0,"adobe","ative") ;winactivate("[TITLE:Adobe Illustrator CC 2018; CLASS:illustrator]", "") ;sleep(1000) MouseClick("left",87,361,1) sleep(1200) ;send("!f") ;sleep(500) ;send("^o") sleep(500) send("!n") sleep(500) ClipPut($pdf_in) sleep(500) send("^v") sleep(500) send("{enter}") sleep(500) ClipPut($FileList[$j]) sleep(500) send("^v") sleep(500) ;msgbox(0,"","wait 178") send("{enter}") sleep(5000) ;while not WinExists("[TITLE:預視; CLASS:illustrator]", "") ; sleep(1500) ; MsgBox(0,"","no response 191",1) while WinExists("[TITLE:Adobe Illustrator; CLASS:#32770]", "偵測到錯誤") sleep(1000) send("{enter}") MsgBox(0,"","mistake",1) wend ;WEnd $re=0 while WinExists ("AAdobe Illustrator CC 2018 (沒有回應)", "") sleep(1000) $re=$re+1 MsgBox(0,$re,"no response open",1) ; if $re>5 Then ; exitloop ;endif WEnd $re=0 while not WinExists ("[TITLE:預視; CLASS:illustrator]", "") sleep(1000) $re=$re+1 MsgBox(0,$re,"no response open",1) if $re>10 Then sleep(1000) while WinExists("[TITLE:進度; CLASS:#32770]", "") ExitLoop wend endif wend ;sleep(3000) msgbox(0,"","wait progress 204",1) while WinExists("[TITLE:進度; CLASS:#32770]", "") sleep(2500) MsgBox(0,"","wait Illustratore progress",1) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; while WinExists("Adobe Illustrator", "不明的影像") sleep(1500) MsgBox(0,"","unknow image",1) winactivate("Adobe Illustrator", "不明的影像") send("{enter}") ; MouseClick(271,290,2) ;ControlClick("", "確定","[CLASS:Button; INSTANCE:1]") WEnd while WinExists("[TITLE:遺失字體; CLASS:#32770]", "") sleep(1500) MsgBox(0,"","no font progress loop",1) winactivate("[TITLE:遺失字體; CLASS:#32770]", "") ;send("{enter}") ControlClick("遺失字體","","left", 63,134,1) ;ControlClick("", "確定","[CLASS:Button; INSTANCE:1]") WEnd while WinExists("Adobe Illustrator", "OS_ViewContainer") ;;; sleep(1500) MsgBox(0,"","image link 233 in progress") winactivate("Adobe Illustrator", "OS_ViewContainer") ;;; sleep(500) send("{tab}") sleep(500) send("{tab}") sleep(500) send("{enter}") sleep(500) msgbox(0,"","wait 423") exitloop 2 ; MouseClick(271,290,2) ;ControlClick("", "確定","[CLASS:Button; INSTANCE:1]") WEnd while WinExists("[TITLE:Adobe Illustrator; CLASS:#32770]", "") sleep(1500) MsgBox(0,"","no image link 433 in progress") sleep(500) winactivate("[TITLE:Adobe Illustrator; CLASS:#32770]", "") sleep(500) send("{tab}") sleep(500) send("{tab}") sleep(500) send("{enter}") sleep(2000) filemove($rr1,$error) sleep(1000) msgbox(0,$rr1,$error) ;filemove($rr1,$error) exitloop 2 ;ControlClick("", "確定","[CLASS:Button; INSTANCE:1]") WEnd wend sleep(4500) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; while WinExists("[TITLE:遺失字體; CLASS:#32770]", "") sleep(1500) MsgBox(0,"","no font",1) winactivate("[TITLE:遺失字體; CLASS:#32770]", "") ;send("{enter}") MouseClick("left",63,329,1) ;ControlClick("", "確定","[CLASS:Button; INSTANCE:1]") sleep(1500) send("^w") sleep(2000) filemove($rr1,$error) sleep(1000) ;msgbox(0,$rr1,$error) ;filemove($rr1,$error) ContinueLoop 2 WEnd while WinExists("Adobe Illustrator", "OS_ViewContainer") ;;; sleep(1500) MsgBox(0,"","image link 268",1) winactivate("Adobe Illustrator", "OS_ViewContainer") ;;; sleep(1000) send("{tab}") sleep(500) send("{tab}") sleep(500) send("{enter}") sleep(2000) filemove($rr1,$error) sleep(1000) ;msgbox(0,$rr1,$error) ;filemove($rr1,$error) ContinueLoop 2 ; MouseClick(271,290,2) ;ControlClick("", "確定","[CLASS:Button; INSTANCE:1]") WEnd while WinExists("[TITLE:遺失字體; CLASS:#32770]", "") sleep(1500) MsgBox(0,"","no font",1) winactivate("[TITLE:遺失字體; CLASS:#32770]", "") ;send("{enter}") MouseClick("left",63,329,1) ;ControlClick("", "確定","[CLASS:Button; INSTANCE:1]") sleep(1500) send("^w") sleep(2000) filemove($rr1,$error) sleep(1000) ;msgbox(0,$rr1,$error) ;filemove($rr1,$error) ContinueLoop 2 WEnd while WinExists("Adobe Illustrator", "不明的影像") sleep(1500) MsgBox(0,"","unknow image",1) winactivate("Adobe Illustrator", "不明的影像") send("{enter}") ; MouseClick(271,290,2) ;ControlClick("", "確定","[CLASS:Button; INSTANCE:1]") WEnd while WinExists("[TITLE:Adobe Illustrator; CLASS:#32770]", "") sleep(1500) MsgBox(0,"","no image link 300") winactivate("[TITLE:Adobe Illustrator; CLASS:#32770]", "") sleep(1000) sleep(500) send("{tab}") sleep(500) send("{tab}") sleep(500) send("{tab}") sleep(500) send("{enter}") sleep(500) exitloop 2 ;ControlClick("", "確定","[CLASS:Button; INSTANCE:1]") WEnd while WinExists("[TITLE:遺失字體; CLASS:#32770]", "") sleep(1500) MsgBox(0,"","no font",1) winactivate("[TITLE:遺失字體; CLASS:#32770]", "") ;send("{enter}") MouseClick("left",63,329,1) ;ControlClick("", "確定","[CLASS:Button; INSTANCE:1]") sleep(1500) send("^w") sleep(2000) filemove($rr1,$error) sleep(1000) ;msgbox(0,$rr1,$error) ;filemove($rr1,$error) ContinueLoop 2 WEnd ;winactivate("[TITLE:Adobe Illustrator CS6; CLASS:illustrator]", "") sleep(5000) MsgBox(0,"","wait 319 open complete",1) while WinExists("[TITLE:Adobe Illustrator; CLASS:#32770]", "檔案已經損壞且無法修復。") sleep(500) MsgBox(0,"","wait bad file",1) winactivate("[TITLE:Adobe Illustrator; CLASS:#32770]", "檔案已經損壞且無法修復。") sleep(1000) ControlClick("", "確定","[CLASS:Button; INSTANCE:1]") ;send("{enter}") filedelete($rr1) sleep(500) exitloop 2 wend $aProcUsage = _ProcessUsageTracker_Create("Illustrator.exe") If @error Then Exit ConsoleWrite("Error calling _ProcessUsageTracker_Create(): " & @error & ", @extended = " & @extended & @CRLF) Sleep(1500) ;$hSplash=SplashTextOn("Process CPU Usage Information", "", 360, 20 + 60, Default, Default, 16, Default, 12) $cpuCount=0 ; Start loop Do $sSplashText="" $fUsage = _ProcessUsageTracker_GetUsage($aProcUsage) If @error Then ConsoleWrite("Error from _ProcessUsageTracker_GetUsage(): " & @error & ", @extended = " &@extended & @CRLF) ExitLoop EndIf msgbox(0,"wait cpu ",$fUsage,2) ;$sSplashText &= "'"&$sProcess&"' CPU usage: " & $fUsage & " %" & @CRLF ;$sSplashText &= @CRLF & "[Esc] exits" $cpuCount=$cpuCount+1 if $cpuCount>100 Then msgbox(0,"","tif cpu ",1) sleep(1000) exitloop 2 endif ;ControlSetText($hSplash, "", "[CLASS:Static; INSTANCE:1]", $sSplashText) Sleep(500) Until ($fUsage<14) _ProcessUsageTracker_Destroy($aProcUsage) msgbox(0,"wait cpu 2",$fUsage,2) ;WinWait("[TITLE:Adobe Illustrator; CLASS:#32770]", "OS_ViewContainer") ;sleep(2000) while WinExists("[TITLE:Adobe Illustrator; CLASS:#32770]", "") sleep(500) MsgBox(0,"","wait Illustratore",1) winactivate("[TITLE:Adobe Illustrator; CLASS:#32770]", "") sleep(500) send("{enter}") sleep(500) wend sleep(2000) winactivate("[TITLE:預視; CLASS:illustrator]", "") sleep(1500) ;;;;;;;;fit artboard ;send("!o") ;sleep(500) ;send("a") ;sleep(500) ;send("b") ;sleep(1000) ;;;;;;;;;;;;;;;;get width ;send("^{F12}") send("!f") sleep(500) send("r") sleep(500) send("{down}") sleep(500) send("{down}") sleep(500) send("{down}") sleep(500) send("{down}") sleep(500) send("{enter}") sleep(500) clipput("C:\automate\getArtboard.js") sleep(500) send("^v");;get 0.25 pt line sleep(1000) send("!o") sleep(3000);;;get widthn0.25 while WinExists("指令碼警告","") WinActivate("指令碼警告","") $Text=ControlGetText("指令碼警告", "","Static2") $width=round($Text,1) sleep(500) send("{enter}") sleep(500) $Text2=ControlGetText("指令碼警告", "","Static2") $height=round($Text2,1) sleep(500) send("{enter}") sleep(500) ;$Value=StringSplit($Text," ") MsgBox(0,$width,$height,1) wend $ratioP=100; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; if ($Dwidth<>'' and abs($Dwidth-$width)>0.6 ) then $ratio=$Dwidth/$width MsgBox(0,"ratio",$ratio,1) $ratioP=$ratio*100 sleep(2000) WinActivate ("[TITLE:預視; CLASS:illustrator]", "") sleep(1000) send("^!a") sleep(1000) send("{space}s") sleep(1000) send("{enter}") sleep(3000) WinActivate("縮放","") sleep(1000) send($ratioP) sleep(1000) send("{enter}") ;wend ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $aProcUsage = _ProcessUsageTracker_Create("Illustrator.exe") If @error Then Exit ConsoleWrite("Error calling _ProcessUsageTracker_Create(): " & @error & ", @extended = " & @extended & @CRLF) Sleep(1500) ;$hSplash=SplashTextOn("Process CPU Usage Information", "", 360, 20 + 60, Default, Default, 16, Default, 12) $cpuCount=0 ; Start loop Do $sSplashText="" $fUsage = _ProcessUsageTracker_GetUsage($aProcUsage) If @error Then ConsoleWrite("Error from _ProcessUsageTracker_GetUsage(): " & @error & ", @extended = " &@extended & @CRLF) ExitLoop EndIf msgbox(0,"wait cpu scale",$fUsage,2) ;$sSplashText &= "'"&$sProcess&"' CPU usage: " & $fUsage & " %" & @CRLF ;$sSplashText &= @CRLF & "[Esc] exits" $cpuCount=$cpuCount+1 if $cpuCount>100 Then msgbox(0,"","exit",1) sleep(1000) exitloop endif ;ControlSetText($hSplash, "", "[CLASS:Static; INSTANCE:1]", $sSplashText) Sleep(500) Until ($fUsage<6) _ProcessUsageTracker_Destroy($aProcUsage) msgbox(0,"wait cpu scale 2",$fUsage,2) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep(3000) WinActivate ("[TITLE:預視; CLASS:illustrator]", "") sleep(1000) send("!o") sleep(1500) send("aa") sleep(1500) send("{enter}") sleep(1000) send("s") endif sleep(1000) send("{space}v") sleep(500) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $rr2=($aiName&"~"&$width*$ratioP*0.01&"~"&$height*$ratioP*0.01&"~.tif") msgBox(0,$rr2,$rr2,1) winactivate("[TITLE:預視; CLASS:illustrator]", "") sleep(1500) send("!f") sleep(500) send("e") sleep(500) send("{down}") sleep(500) send("{enter}") sleep(700) send("!t") sleep(500) send("t") sleep(500) send("t") sleep(700) send("!n") sleep(500) clipput($pdf_out&$rr2) sleep(500) send("^v") sleep(500) ;send("!s") ;ControlClick("儲存 - CGATS", "儲存", "[CLASS:Button; INSTANCE:1]") send("!u") sleep(700) ControlClick("轉存","轉存","[CLASS:Button; INSTANCE:5]") sleep(3000) $re=0 while not WinExists("[TITLE:TIFF 選項; CLASS:#32770]", "") sleep(1500) $re=$re+1 MsgBox(0,$re,"no responde",1) if $re>20 Then exitloop endif WEnd sleep(500) WinActivate("[TITLE:TIFF 選項; CLASS:#32770]", "") sleep(500) ;send("!l") sleep(500) send("!c") sleep(700) send("c") sleep(700) ;send("{tab}") ;sleep(700) ;send("{tab}") ;sleep(700) $area=$width*$height ;MsgBox(0,"area",$area,1) send("!r") sleep(700) if($width>150 or $height>150) then ;;72dpi ; sleep(1000) send("{up}") sleep(700) send("{up}") sleep(700) send("{down}") sleep(700) send("{down}") sleep(700) send("{down}") clipput("100") sleep(1000) send("^v") ;sleep(500) send("{enter}") sleep(500) send("{enter}") sleep(500) elseif ($width>42 or $height>42) Then ;;150 dpi ;sleep(1000) send("{up}") sleep(700) send("{up}") sleep(700) send("{down}") sleep(700) send("{down}") sleep(700) send("{down}") clipput("150") sleep(1000) send("^v") sleep(500) send("{enter}") sleep(500) send("{enter}") sleep(500) Else ; sleep(1000) ;300dpi send("{up}") sleep(700) send("{up}") sleep(700) send("{down}") sleep(700) send("{down}") sleep(700) send("{down}") clipput("300") sleep(1000) send("^v") sleep(500) send("{enter}") sleep(500) send("{enter}") sleep(500) endif sleep(5000) $aProcUsage = _ProcessUsageTracker_Create("Illustrator.exe") If @error Then Exit ConsoleWrite("Error calling _ProcessUsageTracker_Create(): " & @error & ", @extended = " & @extended & @CRLF) Sleep(1500) ;$hSplash=SplashTextOn("Process CPU Usage Information", "", 360, 20 + 60, Default, Default, 16, Default, 12) $cpuCount=0 ; Start loop Do $sSplashText="" $fUsage = _ProcessUsageTracker_GetUsage($aProcUsage) If @error Then ConsoleWrite("Error from _ProcessUsageTracker_GetUsage(): " & @error & ", @extended = " &@extended & @CRLF) ExitLoop EndIf msgbox(0,"wait cpu tif",$fUsage,2) ;$sSplashText &= "'"&$sProcess&"' CPU usage: " & $fUsage & " %" & @CRLF ;$sSplashText &= @CRLF & "[Esc] exits" $cpuCount=$cpuCount+1 if $cpuCount>100 Then msgbox(0,"","exit",1) sleep(1000) exitloop endif ;ControlSetText($hSplash, "", "[CLASS:Static; INSTANCE:1]", $sSplashText) Sleep(500) Until ($fUsage<6) _ProcessUsageTracker_Destroy($aProcUsage) msgbox(0,"wait cpu tif 2",$fUsage,2) msgbox(0,"wait",$rr2,1) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;get width ;$aiName2=StringTrimRight($rr2,4) ;$rr2=($aiName&"_"&$width&"_"&$height&".ai") ;$aiName2=StringTrimRight($rr2,4) ;msgbox(0,"name2",$rr2) winactivate("[TITLE:預視; CLASS:illustrator]", "") sleep(1000) send("{space}v") sleep(500) MouseClick("left",253,78,2) sleep(500) send("^w") sleep(500) ;winactivate("[TITLE:CMYK; CLASS:#32770]", "") ;MouseClick("left",100,78,1) ;sleep(500) ;MouseClick("left",100,78,2) ;sleep(1000) ;send("^w") ;sleep(1000) send("n") sleep(2500) ;send("c") ;sleep(2000) ;FileDelete($rr3) ;sleep(1500) ;filecopy($rr1,$pdf_out&$rr2) filemove($rr1,$hold) ;filemove($pdf_in&"*.ai",$pdf_out&"*.*") sleep(2000) ;; 128 ai action loop sleep(500) ;msgbox(0,"check","here 2") ;msgbox(0,"wait 370",$rr1&","&$pdf_out&$rr2) ;; 119 ai file loop msgbox(0,"","cycle",1) ;msgbox(0,"wait end",$rr1&","&$pdf_out&$rr2) ;FileDelete($rr1) sleep(1000) ;Filemove($rr1,"C:\adfs\hold\*.*") ;FileDelete($rr1) next ;;80 ;; 80 pstill for loop endif ;;71 ;; 71 pstill if file loop ;msgbox(0,"measute:",$measureL&"_"&$measurea&"_"&$measureb); ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;c100;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;endif of agraph ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Case $process ; MsgBox(0, "ss", $s) $s=0 EndSwitch WEnd ;Func DensitySp38() ;ConsoleWrite("ID: "&@GUI_DRAGID & " File: "&@GUI_DRAGFILE &" Drop: "&@GUI_DROPID&@CRLF) ;EndFunc Func Terminate() ;ProcessClose("Wscript.exe") Exit 0 EndFunc