PDA

Показать полную графическую версию : [решено] Скрипт для окна Missing File в Adobe Framemaker


Vadikan
06-11-2009, 13:01
Привет, коллеги!

Прошу создать скомпилированный скрипт для одной специфической задачи в Adobe Framemaker :)

Скриншот окна прикреплен. От скрипта требуется после запуска последовательно ставить радиокнопку Skip This File и нажимать кнопку Continue (или клавишу Ввод) до тех пор, пока диалог не исчезнет.

Дополнительная информация об окне и кнопках приводится ниже. Если нужна еще какая-то, сообщите.

Summary (Skip this file)
>>>> Window <<<<
Title: Missing File
Class: #32770
Position: 126, 76
Size: 853, 621
Style: 0x96CC20C4
ExStyle: 0x00010501
Handle: 0x00040470

>>>> Control <<<<
Class: Button
Instance: 6
ClassnameNN: Button6
Advanced (Class): [CLASS:Button; INSTANCE:6]
ID: 1042
Text: &Skip This File
Position: 23, 530
Size: 275, 20
ControlClick Coords: 60, 10
Style: 0x50010009
ExStyle: 0x00000004
Handle: 0x00030910

>>>> Mouse <<<<
Position: 213, 646
Cursor ID: 2
Color: 0xEBE9ED

>>>> StatusBar <<<<

>>>> Visible Text <<<<
Look &in:
trunk
FolderView
File &name:
File Name Not Applicable
File Name Not Applicable
Files of &type:
All Files (*.*)
&Continue
Cancel
&Update Document To Use New Path
&Skip This File
Ignore &All Missing Files
Looking For:
Document Folder:



>>>> Hidden Text <<<<
Open as &read-only
&Help

Summary (Continue)
>>>> Window <<<<
Title: Missing File
Class: #32770
Position: 126, 76
Size: 853, 621
Style: 0x96CC20C4
ExStyle: 0x00010501
Handle: 0x00040470

>>>> Control <<<<
Class: Button
Instance: 2
ClassnameNN: Button2
Advanced (Class): [CLASS:Button; INSTANCE:2]
ID: 1
Text: &Continue
Position: 753, 435
Size: 75, 23
ControlClick Coords: 33, 19
Style: 0x50010000
ExStyle: 0x00000004
Handle: 0x0003091E

>>>> Mouse <<<<
Position: 916, 560
Cursor ID: 0
Color: 0xA6B8CF

>>>> StatusBar <<<<

>>>> Visible Text <<<<
Look &in:
trunk
FolderView
File &name:
File Name Not Applicable
File Name Not Applicable
Files of &type:
All Files (*.*)
&Continue
Cancel
&Update Document To Use New Path
&Skip This File
Ignore &All Missing Files
Looking For:
Document Folder:
.fm


>>>> Hidden Text <<<<
Open as &read-only
&Help


Спасибо!

Creat0R
06-11-2009, 13:43
Вобщем вот что получилось:

Opt (http://www.autoitscript.com/autoit3/docs/functions/Opt.htm)("WinWaitDelay", 0)

$sTitle = "[CLASS:#32770;TITLE:Missing File]"
$sText = "FolderView"

While (http://www.autoitscript.com/autoit3/docs/keywords.htm#While) WinExists (http://www.autoitscript.com/autoit3/docs/functions/WinExists.htm)($sTitle, $sText)
ControlClick (http://www.autoitscript.com/autoit3/docs/functions/ControlClick.htm)($sTitle, $sText, "[CLASS:Button; INSTANCE:6; TEXT:&Skip This File]")
ControlClick (http://www.autoitscript.com/autoit3/docs/functions/ControlClick.htm)($sTitle, $sText, "[CLASS:Button; INSTANCE:2; TEXT:&Continue]")

Sleep (http://www.autoitscript.com/autoit3/docs/functions/Sleep.htm)(10) ;Это можно убрать если требуется мгновенная обработка, однако это может повлечь за собой нагрузку на ЦП
WEnd (http://www.autoitscript.com/autoit3/docs/keywords.htm#WEnd)

Но насколько я пониманию, после первого нажатия на «Continue» окно исчезнет, и тут возникает вопрос - как определить что окно больше не появится, или сколько ожидать отсутствие окна прежде чем выйти из скрипта?

Vadikan
06-11-2009, 13:57
Спасибо! Пока не работает :)
Но насколько я пониманию, после первого нажатия на «Continue» окно исчезнет »
Сорри, я не совсем точно сформулировал проблему. Последовательность такая получается при ручном вводе.

1. Выбор "Skip This File"
2. Нажатие "Continue" пропускает потерянный файл.
3. Окно закрывается, но Framemaker тут же ищет следующий "потерянный файл" и выводит очередное точно такое же окно, просто вверху, где "Looking for" другое имя файла.

После чего все повторяется до тех пор, пока все потерянные файлы не пропущены.

К сожалению, нажимать Ignore All Missing files нельзя.

Creat0R
06-11-2009, 14:42
Vadikan, Но опять же, остаётся вопрос определения - как скрипт будт знать что окон болше не будет появляться? или может просто нужно установить промежуток времени, по истечению которого будет считаться что окно больше не появится?

P.S
У тебя есть возможность проверять сам скрипт, или обязательно нужно компилировать? Просто было бы проще проверять au3 скрипт пока мы найдём рабочий вариант :)

Vadikan
06-11-2009, 15:02
или может просто нужно установить промежуток времени, по истечению которого будет считаться что окно больше не появится? »
5 секунд будет достаточно.

У тебя есть возможность проверять сам скрипт, или обязательно нужно компилировать? »
Теперь есть.

Creat0R
06-11-2009, 17:44
5 секунд будет достаточно »
Вариант №2:

Opt (http://www.autoitscript.com/autoit3/docs/functions/Opt.htm)("WinWaitDelay", 0)

$sTitle = "[CLASS:#32770;TITLE:Missing File]"
$sText = ""

While (http://www.autoitscript.com/autoit3/docs/keywords.htm#While) 1
_WinWaitVisible($sTitle, $sText, 5)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) Not (http://www.autoitscript.com/autoit3/docs/keywords.htm#Not) _WinVisible($sTitle, $sText) Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) Exit (http://www.autoitscript.com/autoit3/docs/keywords.htm#Exit)

ControlCommand (http://www.autoitscript.com/autoit3/docs/functions/ControlCommand.htm)($sTitle, $sText, "Button6", "Check")
Sleep (http://www.autoitscript.com/autoit3/docs/functions/Sleep.htm)(10)
ControlClick (http://www.autoitscript.com/autoit3/docs/functions/ControlClick.htm)($sTitle, $sText, "Button2")
WEnd (http://www.autoitscript.com/autoit3/docs/keywords.htm#WEnd)

Func (http://www.autoitscript.com/autoit3/docs/keywords.htm#Func) _WinWaitVisible($sTitle, $sText, $iTime=0)
Local (http://www.autoitscript.com/autoit3/docs/keywords.htm#Local) $iTimer = -1
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) $iTime > 0 Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) $iTimer = TimerInit (http://www.autoitscript.com/autoit3/docs/functions/TimerInit.htm)()

While (http://www.autoitscript.com/autoit3/docs/keywords.htm#While) Not (http://www.autoitscript.com/autoit3/docs/keywords.htm#Not) _WinVisible($sTitle, $sText)
Sleep (http://www.autoitscript.com/autoit3/docs/functions/Sleep.htm)(10)
If (http://www.autoitscript.com/autoit3/docs/keywords.htm#If) $iTime > 0 And (http://www.autoitscript.com/autoit3/docs/keywords.htm#And) (TimerDiff (http://www.autoitscript.com/autoit3/docs/functions/TimerDiff.htm)($iTimer) / 1000) >= $iTime Then (http://www.autoitscript.com/autoit3/docs/keywords.htm#Then) ExitLoop (http://www.autoitscript.com/autoit3/docs/keywords.htm#ExitLoop)
WEnd (http://www.autoitscript.com/autoit3/docs/keywords.htm#WEnd)

Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) _WinVisible($sTitle, $sText)
EndFunc (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndFunc)

Func (http://www.autoitscript.com/autoit3/docs/keywords.htm#Func) _WinVisible($sTitle, $sText="")
Return (http://www.autoitscript.com/autoit3/docs/keywords.htm#Return) Number (http://www.autoitscript.com/autoit3/docs/functions/Number.htm)(BitAND (http://www.autoitscript.com/autoit3/docs/functions/BitAND.htm)(WinGetState (http://www.autoitscript.com/autoit3/docs/functions/WinGetState.htm)($sTitle, $sText), 2) = 2)
EndFunc (http://www.autoitscript.com/autoit3/docs/keywords.htm#EndFunc)

Vadikan
06-11-2009, 18:49
Creat0R, супер, то что доктор прописал! Спасибо! :up:




© OSzone.net 2001-2012