Sign in to follow this  
Followers 0
alfa

For loop ? PLS advice

5 posts in this topic

What i want to do is i want to do $season as many as i want and be able to save and open them.

This i cant get it how.

$season1 = InputBox ("Season", "Write in Season name")
Send (" C:\Documents and Settings\aozben\Desktop\Cap Rep\"&$season1&".xls")
Send ("{TAB}")
Send ("{down 3}")
Send("!s")
Sleep(500)
Send("!y")

;season rapor 

$yesNO = MsgBox (4, "Another Season", "Do you need an other Season ?")

While $yesNO = 6
ControlClick("\\himini\production\BrioRpt\asp\5519_capacity_report_short.bqy - Windows Internet Explorer", "", "Panel47")
_sleepUntilXX()
MsgBox (0, "Select Season", "Select Season and clik OK")
ControlClick("\\himini\production\BrioRpt\asp\5519_capacity_report_short.bqy - Windows Internet Explorer", "", "StdBtn25")
_sleepUntilXX()
ControlClick("\\himini\production\BrioRpt\asp\5519_capacity_report_short.bqy - Windows Internet Explorer", "", "StdBtn1")
_sleepUntilXX()
ControlClick("\\himini\production\BrioRpt\asp\5519_capacity_report_short.bqy - Windows Internet Explorer", "", "Panel4")
sleep (500)
MouseClick("left", 54,229,1,0)
MouseClick("left", 188,230,1,0)
WinWaitActive("Export Section")
$season2 = InputBox ("Season", "Write in Season name")
Send (" C:\Documents and Settings\aozben\Desktop\Cap Rep\"&$season2&".xls")
Send ("{TAB}")
Send ("{down 3}")
Send("!s")
Sleep(500)
Send("!y")
Sleep (500)
$yesNO = MsgBox (4, "Another Season", "Do you need an other Season ?")
Wend

;;;;

_sleepUntilXX()

$sinsi = _FileListToArray ("c:\Documents and Settings\aozben\Desktop\Cap Rep\")
$adet = $sinsi[0] - $sinsi[1]

ShellExecute ("TK_LO_Cap_Rep.xls","" ,"C:\Documents and Settings\aozben\Desktop\Cap Rep\")
Sleep (1000)
ShellExecute ("5519_capacity_report_short.xls","" ,"C:\Documents and Settings\aozben\Desktop\Cap Rep\")
Sleep (1000)
ShellExecute ($season1&".xls","" ,"C:\Documents and Settings\aozben\Desktop\Cap Rep\")
Sleep (1000)
If $adet > 4 Then
ShellExecute ($season2&".xls","" ,"C:\Documents and Settings\aozben\Desktop\Cap Rep\")
EndIf

WinActivate ("Microsoft Excel - TK_LO_Cap_Rep.xls  [Compatibility Mode]")

Share this post


Link to post
Share on other sites



you could do

Do

;code here

Until $yesNO = 7 ;(the no button)

It should work

With this yes i can create as many as i want but i cant open them in excel with out knowing the names.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

*edit*

I think I'm missunderstanding what you want.

I can't test as I don't have access to half the stuff in your script but this should give you an idea of where I was trying to dirrect you.

#include <File.au3>
#Include <Array.au3>

Dim $season[1]
$x = 0
$yesNO = MsgBox(4, "Another Season", "Do you need an other Season ?")

Do
    $input = InputBox("Season", "Write in Season name")
    _ArrayAdd($season, $input)
    Send(" C:\Documents and Settings\aozben\Desktop\Cap Rep\" & $season[$x] & ".xls")
    Send("{TAB}")
    Send("{down 3}")
    Send("!s")
    Sleep(500)
    Send("!y")

    ;season rapor
    ControlClick("\\himini\production\BrioRpt\asp\5519_capacity_report_short.bqy - Windows Internet Explorer", "", "Panel47")
    _sleepUntilXX()
    MsgBox(0, "Select Season", "Select Season and clik OK")
    ControlClick("\\himini\production\BrioRpt\asp\5519_capacity_report_short.bqy - Windows Internet Explorer", "", "StdBtn25")
    _sleepUntilXX()
    ControlClick("\\himini\production\BrioRpt\asp\5519_capacity_report_short.bqy - Windows Internet Explorer", "", "StdBtn1")
    _sleepUntilXX()
    ControlClick("\\himini\production\BrioRpt\asp\5519_capacity_report_short.bqy - Windows Internet Explorer", "", "Panel4")
    Sleep(500)
    MouseClick("left", 54, 229, 1, 0)
    MouseClick("left", 188, 230, 1, 0)
    WinWaitActive("Export Section")

    $yesNO = MsgBox(4, "Another Season", "Do you need an other Season ?")
    $x += 1
Until $yesNO = 7

;;;;

_sleepUntilXX()

$sinsi = _FileListToArray("c:\Documents and Settings\aozben\Desktop\Cap Rep\")
$adet = $sinsi[0] - $sinsi[1]

ShellExecute("TK_LO_Cap_Rep.xls", "", "C:\Documents and Settings\aozben\Desktop\Cap Rep\")
Sleep(1000)
ShellExecute("5519_capacity_report_short.xls", "", "C:\Documents and Settings\aozben\Desktop\Cap Rep\")
Sleep(1000)
For $x = 0 To UBound($season)
    ShellExecute($season[$x] & ".xls", "", "C:\Documents and Settings\aozben\Desktop\Cap Rep\")
    Sleep(1000)
Next

WinActivate("Microsoft Excel - TK_LO_Cap_Rep.xls  [Compatibility Mode]")
Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

This is exactly what i was trying to ask :huh2: It is probably me not being able to ask, not you ;)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0