<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; File Loop read или Копировать и вставить]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=10892&amp;type=atom" />
	<updated>2015-09-05T01:25:01Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=10892</id>
		<entry>
			<title type="html"><![CDATA[Re: File Loop read или Копировать и вставить]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=97100#p97100" />
			<content type="html"><![CDATA[<p>Спасибо за ответ&nbsp; немного помогло.<br />Сделал скрипт работает на половину, ошибка в условии проверки. Есть окно или нет. </p><div class="codebox"><pre><code>run = 0
Gui, Add, Edit, x202 y30 w90 h20 vEdit2 , ; Кол-во повторов
Gui, Add, Button, x5 y5 w120 h30 gMyButtonOK, OK
Gui, Add, Button, x5 y50 w120 h30 , ОТКРЫТЬ
; Generated using SmartGUI Creator for SciTE
Gui, Show, w333 h100, работа
return

MyButtonOK: 
GuiControlGet, Edit2 ; 
loop %Edit2% 
    {
          WinWait, Microsoft Excel - кар, Строка состояния
         IfWinNotActive, Microsoft Excel - кар, Строка состояния, WinActivate, Microsoft Excel - кар, Строка состояния
         WinWaitActive, Microsoft Excel - кар, Строка состояния
         Send, {home}+{end}^{vk58}
         Sleep, 100
         Send, {Down}
         Sleep, 150
         if (A_Language = &quot;0419&quot;)
         WinWait, Ввод ( Информация) ,
         IfWinNotActive, Ввод ( Информация) , , WinActivate, Ввод ( Информация) ,
         WinWaitActive, Ввод ( Информация) ,
         Sleep, 150
         ControlClick,  TEdit3 ;  поиск окна 
         Sleep, 150
            Send, % SubStr(clipboard,1,13)
         Sleep, 1000
         clipboard = ; Очищает клипборд.
         Sleep, 400
         ControlClick, tEdit5 ;выделяет окно ввода
         ControlClick, tEdit5 ;выделяет окно ввода 
         ControlClick, tEdit5
         Send, {home}+{end}^{vk43}
         Sleep, 100
         Send, {enter}
         Sleep, 100
         Send, ^vk56
         Sleep, 100
         Send, {enter}{enter}{enter}
         Sleep, 100
         Send, {vk28}{vk28}
         Sleep, 100
         Send, {enter}{enter}
         Sleep, 100
         IfWinExist, Вопрос, Нет ; тут программа перестает работать с условием проверки есть ли окно (Вопрос, Нет)
            {
             WinWait, Вопрос, Нет
             IfWinNotActive, Вопрос, Нет, WinActivate, Вопрос, Нет
             WinWaitActive, Вопрос, Нет
             Send, {vkD}
                          Sleep, 100
                         ControlClick, TButton1
             Sleep, 1000
             Send,{F5}
             Sleep, 100
             SoundPlay *48  ; звек при удачной ре
             Sleep, 2000
            }
    else
            {
             WinWait, Вопрос, Нет
             IfWinNotActive, Вопрос, Нет, WinActivate, Вопрос, Нет
             WinWaitActive, Вопрос, Нет
             Sleep, 1000  
             Send, {F5}
             Sleep, 100
             SoundPlay *48  ; звек при удачной ре
             Sleep, 2000 
            }
    }
return
ButtonОТКРЫТЬ:
run %A_ScriptDir%\кар.xlsx
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[rous]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33302</uri>
			</author>
			<updated>2015-09-05T01:25:01Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=97100#p97100</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: File Loop read или Копировать и вставить]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=96797#p96797" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>nameFile := &quot;list.txt&quot;

Gui, Add, text,y10 ,Список:
Gui, Add, Edit,xp yp+15 w160 h570,

Gui, Add, text,y10 xp+170,кол-во повторов:
Gui, Add, Edit,xp yp+15 w100 Number,1

Gui, Add,button,xp yp+25 w100 gok,ОК
Gui Show, h600
return

ok:
List := &quot;&quot;,ListOk := &quot;&quot;
GuiControlGet,Edit1
GuiControlGet,Edit2
if (Edit2 = 0)
    {
    Msgbox,0x30,Ошибка,Второе поле не может быть равно 0
    return
    }
Else if !(Edit1 and Edit2)
    {
    Msgbox,0x30,Ошибка,Должны быть заполнены оба поля.
    return
    }
    
Edit1 :=  RegExReplace(Edit1,&quot;`tок&quot;,&quot;&quot;)

loop,parse,Edit1,`n
    {
    if A_LoopField
    List.= (!List? &quot;&quot; : &quot;`n&quot;) A_LoopField ((A_Index &lt;= Edit2)? &quot;`tок&quot; : &quot;&quot;)
    if (A_Index &lt;= Edit2)
        ListOk .= (!ListOk? &quot;&quot; : &quot;`n&quot;) A_LoopField
    MaxIndexL := A_Index
    }
GuiControl,,Edit1,%List%

FileDelete %A_ScriptDir%\%nameFile%
FileAppend %ListOk%, %A_ScriptDir%\%nameFile%
Run %A_ScriptDir%\%nameFile%

if ((MaxIndexL - Edit2) &lt; 0)
    Msgbox,0x40,,Строк меньше чем указано во втором поле.
return

GuiClose:
ExitApp
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[yalanne]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=32850</uri>
			</author>
			<updated>2015-08-24T09:06:49Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=96797#p96797</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[File Loop read или Копировать и вставить]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=96738#p96738" />
			<content type="html"><![CDATA[<p>Доброго дня .</p><p>Помогите скрипт работает не корректно.<br />Скрипт копирует все имена сразу указанное кол-во раз. А надо по одному имени и через 5 секунд.<br />Суть работы скрипта:<br />1.Найти окно, скопировать надпись, нажать пробел и вставить (ОК)<br />2.Перейти на строчку ниже<br />3.Найти текстовый документ, вставить надпись.<br />И так нужное кол-во раз.<br />Заранее всем спасибо.<br />Должно получиться так.<br /><span class="postimg"><img src="http://i004.radikal.ru/1508/12/3c59bd43f18d.jpg" alt="http://i004.radikal.ru/1508/12/3c59bd43f18d.jpg" /></span>&nbsp; &nbsp; <span class="postimg"><img src="http://i072.radikal.ru/1508/65/b08b3ba6d626.jpg" alt="http://i072.radikal.ru/1508/65/b08b3ba6d626.jpg" /></span><br />Сам скрипт.<br /></p><div class="codebox"><pre><code>Gui, Add, Edit, x12 y30 w160 h860 vEdit1 , 
Gui, Add, Edit, x202 y30 w90 h20 vEdit2 , ; кол-во повторов.
Gui, Add, Button, x192 y180 w120 h30 gMyButtonOK, OK
Gui, Add, Text, x22 y9 w130 h20 , 
Gui, Add, Text, x192 y10 w120 h20 , кол-во повторов
; Generated using SmartGUI Creator for SciTE
Gui, Show, w333 h906, KAP
return

MyButtonOK: 
GuiControlGet, Edit1 ;
GuiControlGet, Edit2 ;
loop %Edit2% ;number of retries specified below steps
{
    WinWait, KAP, 
IfWinNotActive, KAP, , WinActivate, KAP, 
WinWaitActive, KAP, 
MouseClick, left,  60,  314
Sleep, 100
ClipSaved := Clipboard
    if(Clipboard&lt;&gt;&quot;&quot;)
    {
        Clipboard =
        sleep, 50
    }
    send {home}
    send +{end}
    send ^c
    clipwait, 1
Send, vk20
Send, OK
Send,{ENTER}
Sleep, 200
WinWait, New Text Document.txt - Notepad, 
IfWinNotActive, New Text Document.txt - Notepad, , WinActivate, New Text Document.txt - Notepad, 
WinWaitActive, New Text Document.txt - Notepad, 
Sleep, 200
send %Edit1%
send {ENTER}
}
</code></pre></div><p>Скрипт на основе ниже написанного не подходит из за задержек ввода имен по очереди<br /></p><div class="codebox"><pre><code>F3::
#IfWinActive GTA:SA:MP
File = C:\Users\user\Documents\test.txt

Loop, Read, %File%
{
    SendInput, {F6}%A_LoopReadLine%{Enter}
    Sleep, 500
}
Return</code></pre></div><p>Заранее спасибо.</p>]]></content>
			<author>
				<name><![CDATA[rous]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=33302</uri>
			</author>
			<updated>2015-08-22T12:50:27Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=96738#p96738</id>
		</entry>
</feed>
