1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. AlphavibeZ

Beiträge von AlphavibeZ

  • Text in iFrame schreiben

    • AlphavibeZ
    • 1. Februar 2018 um 14:16

    Hallo, schon wieder ich :Face:


    Ich habe nun folgendes Problem, dass ich automatisch eine Artikelbeschreibung posten möchte. Allerdings sitzt die Textarea in einem iFrame.

    Über die Textarea direkt übernimmt er den Text nicht. Hier der Quellcode der Textarea

    Code
    <textarea id="products_description[2]" name="products_description[2]" wrap="soft" cols="103" rows="30" style="visibility: hidden; display: none;">
    Hier der Text</textarea>


    Hab dann mit dem Developer Tool von Chrome gesehen, dass der Text auch nochmal in einem iFrame sitzt. Das ist der Quellcode

    Code
    <iframe src="" frameborder="0" class="cke_wysiwyg_frame cke_reset" title="WYSIWYG-Editor, products_description[2]" aria-describedby="cke_90" tabindex="0" allowtransparency="true" style="width: 100%; height: 100%;"></iframe>


    Der Text sitzt dann hier drin :

    Code
    <body contenteditable="true" class="cke_editable cke_editable_themed cke_contents_ltr cke_show_borders" spellcheck="false">Hier der Text</body>


    Der name soll laut developer tool auch "WYSIWYG-Editor, products_description[2]" sein, allerdings kann ich mit

    Code
    $oBeschreibung = _IEFormElementGetObjByName ($oForm, "WYSIWYG-Editor, products_description[2]")
     _IEFormElementSetValue ($oBeschreibung , "Test")

    keinen Text reinschreiben. Hat jemand eine Ahnung wo mein Fehler liegt?


    So sieht es im Developer tool aus :

    [Blockierte Grafik: http://www.bilder-upload.eu/thumb/7db4cf-1517491246.jpg]

    [Blockierte Grafik: http://www.bilder-upload.eu/thumb/9d8331-1517491284.jpg]


    LG

    Alpha

  • mit "IF" Funktion mehrere Variablen ansprechen

    • AlphavibeZ
    • 1. Februar 2018 um 13:56

    Funktioniert super. Danke für die Mühe!

  • mit "IF" Funktion mehrere Variablen ansprechen

    • AlphavibeZ
    • 31. Januar 2018 um 22:46
    Zitat von Musashi

    Setze einfach mal ein :

    #include <Array.au3>

    an den Anfang des Skriptes, und nach der Besetzung der Arrayelemente die Zeile :

    _ArrayDisplay($aHersteller)

    Dann bekommst Du die Werte angezeigt.

    Gruß Musashi

    Alles anzeigen

    danke, das hilft mir bei der kontrolle :)! habe mein ziel erreicht für heute, morgen gehts weiter. Da haben sich die 14 stunden heute gelohnt. Schönen Abend euch!

  • mit "IF" Funktion mehrere Variablen ansprechen

    • AlphavibeZ
    • 31. Januar 2018 um 22:41
    Zitat von Musashi

    In der Zeile :

    ["Oligo" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_376&action=new_product" , "", _

    fehlt hinten eine Klammer. Korrekt wäre :

    ["Oligo" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_376&action=new_product" , ""], _

    Augen wie ein Luchs. Bin beeindruckt. Vielen Dank!


    €:

    Habe es nun auch hinbekommen, die Daten zu holen und es funktioniert alles. Vielen Dank für alles Leute!!!

    Code
    $oManufacturer = _IEFormElementGetObjByName ($oForm, "manufacturers_id")
        For $i2 = 0 To Ubound($aHersteller) - 1
          If $s_hersteller = $aHersteller[$i2][0] Then
          _IEFormElementSetValue ($oManufacturer, $aHersteller[$i2][2])
        EndIf
       Next
  • mit "IF" Funktion mehrere Variablen ansprechen

    • AlphavibeZ
    • 31. Januar 2018 um 22:36

    Funktioniert nur leider nicht ;(

    bekomme leider die ganze zeit diesen error

  • mit "IF" Funktion mehrere Variablen ansprechen

    • AlphavibeZ
    • 31. Januar 2018 um 22:29
    Code
    Global $aHersteller[][] = [ _
    ["Albert" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_361&action=new_product" , "46"], _
    ["Anta" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_359&action=new_product" , "73"], _
    ["Artemide" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_360&action=new_product" , "17"], _
    ["B+M Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_362&action=new_product" ,"32"], _
    ["BM Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_362&action=new_product" , "32"], _
    ["B-Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_364&action=new_product" , "80"], _
    ["Bankamp" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_363&action=new_product" , "84"], _
    ["Basis Design" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_372&action=new_product" , "70"], _
    ["Bega" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_373&action=new_product" , "41"], _
    ["Bega Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_373&action=new_product" , "41"], _
    ["Blomus" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_421&action=new_product" , "30"], _
    ["Blux" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_365&action=new_product" , ""], _
    ["Böhmer Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_369&action=new_product" , "1"], _
    ["Böhmer" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_369&action=new_product" , "1"], _
    ["Bopp Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_418&action=new_product" , "87"], _
    ["Bopp" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_418&action=new_product" , "87"], _
    ["Brilliant" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_368&action=new_product" , "82"], _
    ["Bruck Design" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_366&action=new_product" , "91"], _
    ["Bruck" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_366&action=new_product" , "91"], _
    ["BTR" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_367&action=new_product" , "86"], _
    ["btr" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_367&action=new_product" , "54"], _
    ["Casablanca Design" , "https://www.wohnkult24.com/admin/categories.php?cPath=370_362&action=new_product" , ""], _
    ["CMD" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_379&action=new_product" , ""], _
    ["Delta Light" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_392&action=new_product" , ""], _
    ["Eglo" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_424&action=new_product" , ""], _
    ["Escale" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_375&action=new_product" , ""], _
    ["Evotec" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_530&action=new_product" , ""], _
    ["Fabas Luce" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_434&action=new_product" , ""], _
    ["Fischer m6 Systeme" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_405&action=new_product" , ""], _
    ["Fischer Shine" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_380&action=new_product" , ""], _
    ["GKS Knapstein" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_460&action=new_product" , ""], _
    ["GKS" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_460&action=new_product" , ""], _
    ["Knapstein" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_460&action=new_product" , ""], _
    ["GKS - Knapstein" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_460&action=new_product" , ""], _
    ["Grossmann" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_387&action=new_product" , ""], _
    ["Helestra" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_389&action=new_product" , ""], _
    ["Holtkötter" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_385&action=new_product" , ""], _
    ["Honsel" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_382&action=new_product" , ""], _
    ["Honsel Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_382&action=new_product" , ""], _
    ["Hufnagel" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_438&action=new_product" , ""], _
    ["Icone" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_440&action=new_product" , ""], _
    ["Ingo Maurer" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_435&action=new_product" , ""], _
    ["IP44 Design" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_439&action=new_product" , ""], _
    ["Kundalini" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_384&action=new_product" , ""], _
    ["LCD" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_423&action=new_product" , ""], _
    ["Leuchtendirekt" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_532&action=new_product" , ""], _
    ["Limburg" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_374&action=new_product" , ""], _
    ["Limburg Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_374&action=new_product" , ""], _
    ["Lucelab" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_432&action=new_product" , ""], _
    ["Lucide" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_377&action=new_product" , ""], _
    ["Lutec" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_383&action=new_product" , ""], _
    ["Milan" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_394&action=new_product" , ""], _
    ["Nemo" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_433&action=new_product" , ""], _
    ["Nordlux" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_388&action=new_product" , ""], _
    ["Oligo" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_376&action=new_product" , "", _
    ["Philips" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_390&action=new_product" , ""], _
    ["Rösle" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_441&action=new_product" , ""], _
    ["Serien Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_416&action=new_product" , ""], _
    ["Slamp" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_386&action=new_product" , ""], _
    ["SLV" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_462&action=new_product" , ""], _
    ["Studio Italia Design" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_436&action=new_product" , ""], _
    ["Trio Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_391&action=new_product" , ""], _
    ["Vibia" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_393&action=new_product" , ""], _
    ["Wofi Action" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_430&action=new_product" , ""], _
    ["Wofi Leuchten", "https://www.wohnkult24.com/admin/categories.php?cPath=356_429&action=new_product" , ""] ]
    
    
    For $i = 0 To UBound($aHersteller) - 1
        If $s_hersteller = $aHersteller[$i][0] Then
            _IENavigate($oIE, $aHersteller[$i][1])
        EndIf
    Next
    Alles anzeigen


    bin grad noch am werte eintragen , sollte aber trotzdem funktionieren

  • mit "IF" Funktion mehrere Variablen ansprechen

    • AlphavibeZ
    • 31. Januar 2018 um 22:26

    Habe grade versucht die 3 Spalte einzufügen, aber dann bekomme ich wieder den Fehler


    "Array variable has incorrect number of subscripts or subscript dimension range exceeded."

    sieht so bei mir aus, da müsste doch eigentlich die 3te spalte problemlos funktionieren, oder?

    Global $aHersteller[][3]

  • mit "IF" Funktion mehrere Variablen ansprechen

    • AlphavibeZ
    • 31. Januar 2018 um 22:18

    Ja, habs nochmal damit versucht ^^

    Hab jetzt nochmal nur [] [2] geschrieben und jetzt läufts! super, tausend dank!

    Jetzt wär ich wieder beim urpsrungsproblem :

    Ich habe mir gedacht, dass ich jetzt noch eine 3 Spalte in das Array einfügen kann und den Wert dieser Spalte später in das Webformular übertragen. Sollte doch eigentlich funktionieren oder? Die Frage ist bloß, wie hol ich mir jetzt den Wert aus der 3ten Spalte des arrays?

  • mit "IF" Funktion mehrere Variablen ansprechen

    • AlphavibeZ
    • 31. Januar 2018 um 22:08

    Gerne (und zwischendrin mal ein herzliches Danke für deine Hilfe, auch wenn wir keine Lösung finden sollten!)

    Code
    Global $aHersteller[4][2] = [ _
    ["Albert" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_361&action=new_product"], _
    ["Anta" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_359&action=new_product"], _
    ["B+M Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_362&action=new_product"], _
    ["BM Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_362&action=new_product"], _
    ["B-Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_364&action=new_product"], _
    ["Bankamp" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_363&action=new_product"], _
    ["Basis Design" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_372&action=new_product"], _
    ["Bega" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_373&action=new_product"], _
    ["Bega Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_373&action=new_product"], _
    ["Blomus" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_421&action=new_product"], _
    ["Blux" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_365&action=new_product"], _
    ["Böhmer Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_369&action=new_product"], _
    ["Böhmer" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_369&action=new_product"], _
    ["Bopp Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_418&action=new_product"], _
    ["Bopp" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_418&action=new_product"], _
    ["Brilliant" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_368&action=new_product"], _
    ["Bruck Design" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_366&action=new_product"], _
    ["Bruck" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_366&action=new_product"], _
    ["BTR" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_367&action=new_product"], _
    ["btr" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_367&action=new_product"], _
    ["Casablanca Design" , "https://www.wohnkult24.com/admin/categories.php?cPath=370_362&action=new_product"], _
    ["CMD" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_379&action=new_product"], _
    ["Delta Light" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_392&action=new_product"], _
    ["Eglo" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_424&action=new_product"], _
    ["Escale" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_375&action=new_product"], _
    ["Evotec" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_530&action=new_product"], _
    ["Fabas Luce" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_434&action=new_product"], _
    ["Fischer m6 Systeme" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_405&action=new_product"], _
    ["Fischer Shine" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_380&action=new_product"], _
    ["GKS Knapstein" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_460&action=new_product"], _
    ["GKS" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_460&action=new_product"], _
    ["Knapstein" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_460&action=new_product"], _
    ["GKS - Knapstein" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_460&action=new_product"], _
    ["Grossmann" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_387&action=new_product"], _
    ["Helestra" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_389&action=new_product"], _
    ["Holtkötter" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_385&action=new_product"], _
    ["Honsel" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_382&action=new_product"], _
    ["Honsel Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_382&action=new_product"], _
    ["Hufnagel" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_438&action=new_product"], _
    ["Icone" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_440&action=new_product"], _
    ["Ingo Maurer" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_435&action=new_product"], _
    ["IP44 Design" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_439&action=new_product"], _
    ["Kundalini" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_384&action=new_product"], _
    ["LCD" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_423&action=new_product"], _
    ["Leuchtendirekt" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_532&action=new_product"], _
    ["Limburg" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_374&action=new_product"], _
    ["Limburg Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_374&action=new_product"], _
    ["Lucelab" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_432&action=new_product"], _
    ["Lucide" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_377&action=new_product"], _
    ["Lutec" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_383&action=new_product"], _
    ["Milan" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_394&action=new_product"], _
    ["Nemo" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_433&action=new_product"], _
    ["Nordlux" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_388&action=new_product"], _
    ["Oligo" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_376&action=new_product"], _
    ["Philips" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_390&action=new_product"], _
    ["Rösle" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_441&action=new_product"], _
    ["Serien Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_416&action=new_product"], _
    ["Slamp" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_386&action=new_product"], _
    ["SLV" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_462&action=new_product"], _
    ["Studio Italia Design" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_436&action=new_product"], _
    ["Trio Leuchten" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_391&action=new_product"], _
    ["Vibia" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_393&action=new_product"], _
    ["Wofi Action" , "https://www.wohnkult24.com/admin/categories.php?cPath=356_430&action=new_product"], _
    ["Wofi Leuchten", "https://www.wohnkult24.com/admin/categories.php?cPath=356_429&action=new_product"] ]
    
    
    For $i = 0 To UBound($aHersteller) - 1
        If $s_hersteller = $aHersteller[$i][0] Then
            _IENavigate($oIE, $aHersteller[$i][1])
        EndIf
    Next
    Alles anzeigen
  • mit "IF" Funktion mehrere Variablen ansprechen

    • AlphavibeZ
    • 31. Januar 2018 um 22:05

    Jetzt gibt er mir eine neue Fehlermeldung :

    Array variable has incorrect number of subscripts or subscript dimension range exceeded.


    Wenn ich jetzt allerdings [63][2] eingebe gibt er mir wieder den dim error

  • mit "IF" Funktion mehrere Variablen ansprechen

    • AlphavibeZ
    • 31. Januar 2018 um 22:00

    Hab ich gerade geändert. Dennoch die gleiche Fehlermeldung ||

  • mit "IF" Funktion mehrere Variablen ansprechen

    • AlphavibeZ
    • 31. Januar 2018 um 21:52

    Ich kann die Email, das PW und Namen des Lieferanten eingeben, sprich die InputBox öffnet sich. Danach stürzt es ab.

  • mit "IF" Funktion mehrere Variablen ansprechen

    • AlphavibeZ
    • 31. Januar 2018 um 21:48

    ^^ ich verstehe , dass du mich das fragst

    aber ja, das letzte komma auch

  • mit "IF" Funktion mehrere Variablen ansprechen

    • AlphavibeZ
    • 31. Januar 2018 um 21:41
    Zitat von alpines

    Deine Arraydeklaration ist falsch, das letzte Underscore _ darf dort nicht sein, da du keine neue Zeile beginnst sondern das Array schließt.

    Außerdem solltest du niemals Variablen global in Funktionen erzeugen, das ist wirklich wirklich schlechter Stil.

    Wenn du die Variablen nur in der Funktion verwendest, dann nimm als Scope lieber Local.

    Okay, habe das mit Global geändert. auch das Underscore ist entfernt, Fehlermeldung bleibt jedoch die gleiche

  • mit "IF" Funktion mehrere Variablen ansprechen

    • AlphavibeZ
    • 31. Januar 2018 um 21:32

    Bekomme dauernd den fehler "Error : Missing subscript dimensions in "Dim" statement." und finde den Fehler einfach nicht.


    Hier mal mein ganzer Quellcode :

    C
    ; Zusätzliche Befehle zur Steuerung des Internet Explorers und des GUI einbinden
    #Region include Befehle
    
    #include <ie.au3>
    #include <GUIConstantsEx.au3>
    #include <Array.au3>
    
    ; AutoIt Symbol unten rechts bei der Uhr ausblenden
    #NoTrayIcon
    #EndRegion include Befehle
    
    
    
    ;Hier befinden sich die Eingabemasken zum Anmelden auf der Homepage und die dazugehörigen Codierungen
    #Region Standard Variablen und Anmeldung
    ; Welcher Benutzername und welches Passwort soll zur Anmeldung genommen werden?
    $s_email = InputBox("E-Mail","Bitte geben Sie die E-Mail ein")
    $s_Passwort = InputBox("Passwort","Bitte geben Sie das Passwort ein","","*")
    
    
    ; Webseite öffnen auf der wir uns anmelden wollen
    $oIE = _IECreate ("homepage","",0,1)
    
    ; Nun warten wir bis die Webseite vollständig geladen ist:
    _IELoadWait($oIE,0)
    
    ; Innerhalb dieser Webseite gibt es ein Formular - Wir holen uns einen Zeiger auf dieses Formular
    $oForm = _IEFormGetObjByName ($oIE, "loginbox")
    
    ; Im Formular gibt es Felder für Benutzername, Passwort und eine Checkbox das die Bedingungen angenommen werden
    ; Wir holen uns Zeiger auf alle diese Elemente
    $oQueryUsername = _IEFormElementGetObjByName ($oForm, "email_address")
    $oQueryPassword = _IEFormElementGetObjByName ($oForm, "password")
    
    ; Wir haben Zeiger auf alles was wir brauchen - legen wir los!
    
    ; Benutzernamen in das vorgesehende Feld eintragen:
    _IEFormElementSetValue ($oQueryUsername,$s_email)
    ; Passwort in das vorgesehende Feld eintragen;
    _IEFormElementSetValue ($oQueryPassword,$s_Passwort)
    
    ; Wir haben alles ausgefüllt, nun senden wir das Formular (Beim Formular war method="post" im Quelltext gesetzt!)
    _IEFormSubmit($oForm)
    
    ; Warten bis die Seite geladen ist
    _IELoadWait($oIE,0)
    
    
    #EndRegion Standard Variablen und Anmeldung
    
    
    
    ;Nun wollen wir zum korrekten Hersteller Navigieren
    #Region Hersteller
    
    
    Herstellerseite()
    
    ;Als erstes erstellen wir die Variable "Hersteller" und deklarieren sie in einer InputBox
    Func Herstellerseite()
    global $s_hersteller = InputBox("Hersteller","Bitte geben Sie den Hersteller an")
    
    
    
    
    
    #Region Hersteller Array
    
    
    Global $aHersteller[][2] = [ _
    ["Albert", "link"], _
    ["Anta", "link"], _
    ["B+M Leuchten" , "link"],_
    ["BM Leuchten" , "link"],_]
    ;hier halt die ganzen hersteller
    
    For $i = 0 To UBound($aHersteller) - 1
        If $s_hersteller = $aHersteller[$i][0] Then
            _IENavigate($oIE, $aHersteller[$i][1])
        EndIf
    Next
    
    
    
    
    #EndRegion HerstellerArray
    
    
    ; Warten bis die Seite geladen ist
    _IELoadWait($oIE,0)
    EndFunc
    
    #EndRegion Hersteller
    
    
    
    ;hier erstellen und verschachteln wir die GUIs
    #Region GUI
    gui1()
    
    Func gui1()
        global $hGUI1 = GUICreate("Artikel Anlegen", 650,550)
        global $sLagerbestand = GUICtrlCreateLabel("Lagerbestand", 20, 20)
        Global $TooltipLagerbestand = GUICtrlCreateLabel("[ ? ]", 205,20)
        GUICtrlSetTip (-1,"Bitte den Aktuellen Lagerbestand eingeben!")
        global $Input_lagerbestand = GUICtrlCreateInput("", 100, 20, 100, 20)
        global $sArtikelnummer = GUICtrlCreateLabel("Art. Nr.", 20, 60)
        global $Input_artnr = GUICtrlCreateInput("", 100, 60, 100, 20)
        Global $s_efficiency = GUICtrlCreateLabel ("Effizienz", 20, 100)
        Global $Input_efficiency = GUICtrlCreateCombo ("Nicht vorhanden",100,100,100,20)
        GuiCtrlSetData ($Input_efficiency, "A|A+|A++|A+++", "Item2")
        Global $TooltipEffizienz = GUICtrlCreateLabel("[ ? ]", 205,100)
        GUICtrlSetTip (-1,"Falls der Artikel keine Effizienzklasse hat, -nicht vorhanden- auswählen")
    
        global $sArtikelname = GUICtrlCreateLabel ("Artikelname", 20,140)
        global $Input_prodname = GUICtrlCreateInput ("", 100, 140, 100 , 20)
        global $sPreis = GUICtrlCreateLabel ("Preis", 20,180)
        global $Input_price = GUICtrlCreateInput ("", 100, 180, 100 , 20)
        global $Button_abschicken = GUICtrlCreateButton("Abschicken", 20, 340, 80, 25)
        global $Button_schliessen = GUICtrlCreateButton("Schließen", 120, 340, 80, 25)
        GUISetState()
    
        Local $sComboRead = ""
    
    
        While 1
            Switch GUIGetMsg()
                Case $GUI_EVENT_CLOSE
                    ExitLoop
                Case $Button_abschicken
                     $lagerbestand = GUICtrlRead($Input_Lagerbestand)  ; Lagerbestand
                     $artnr = GUICtrlRead($Input_artnr) ; Artikelnummer
                     $artikelname = GuiCtrlRead ($Input_prodname) ; Artikelname
                     $preis = GuiCtrlRead ($Input_price) ; Preis
                     global $effizienz = GuiCtrlRead ($Input_efficiency); Effizienz
    
                If $lagerbestand = "" or $artnr = "" or $artikelname = "" or $preis = "" Then
                      MsgBox (0,"Info","Bitte alle Felder auswählen!")
                   Else
                    _abschicken($lagerbestand, $artnr, $artikelname, $preis)
    
    
                     GUISetState (@SW_HIDE,$hGUI1)
                     gui2()
    
                     GUISetState (@SW_SHOW, $hGUI2)
                  EndIf
               Case $Button_schliessen
                  Exit 0
            EndSwitch
         WEnd
    
    
    
    EndFunc   ;==>gui1
    
    Func gui2()
        global $hGUI2 = GUICreate("weiteren Artikel anlegen?", 200, 200, 350, 350)
        Local $yesButton = GUICtrlCreateButton("Ja", 10, 10, 80, 30)
        Local $noButton = GUICtrlCreateButton("Nein", 10, 60, 80, 30)
        GUISetState()
    
        While 2
            Switch GUIGetMsg()
                Case $GUI_EVENT_CLOSE
                    GUIDelete($hGUI2)
                    ExitLoop
                 Case $yesButton
    
                    ; Disable the second GUI
    
                    GUISetState (@SW_HIDE,$hGUI2)
                       call ("Herstellerseite")
                   _IELoadWait($oIE,0)
                    call ("gui1")
                    GUISetState (@SW_SHOW,$hGUI1)
    
        GUISetState()
    
                 Case $noButton
                Exit 0
            EndSwitch
        WEnd
    
    EndFunc   ;==>gui2
    
    
    
    
    Func _abschicken($lagerbestand,$artnr, $artikelname, $preis)
    
        $oForm = _IEGetObjById($oIE, "new_product")
    
        $oQuantity = _IEFormElementGetObjByName($oForm, "products_quantity") ; Lagerbestand
        _IEFormElementSetValue($oQuantity, $lagerbestand) ; Lagerbestand
    
        $oModel = _IEFormElementGetObjByName($oForm, "products_model") ; Artikelnummer
        _IEFormElementSetValue($oModel, $artnr) ; Artikelnummer
    
        $oName = _IEFormElementGetObjByName($oForm, "products_name[2]") ; Artikelname
        _IEFormElementSetValue($oName, $artikelname) ; Artikelname
    
        $oPreis = _IEFormElementGetObjByName ($oForm, "products_price") ; Preis
        _IEFormElementSetValue ($oPreis, $preis) ;Preis
    
        $oEfficiency = _IEFormElementGetObjByName ($oForm, "agi_google_energy_efficiency")
        _IEFormElementSetValue ($oEfficiency, $effizienz)
    
        ; Fixe Einstellungen welche immer übermittelt werden.
    
    
    
        $oLieferzeit = _IEFormElementGetObjByName ($oForm, "shipping_status") ;Lieferzeit
        _IEFormElementSetValue ($oLieferzeit, 9) ;Lieferzeit
    
        $oVerpackungseinheit = _IEFormElementGetObjByName ($oForm, "products_vpe") ;VPE
        _IEFormElementSetValue ($oVerpackungseinheit, 1) ;VPE
    
        $oArtikeldetails = _IEFormElementGetObjByName ($oForm, "info_template") ;Artikeldetails
        _IEFormElementSetValue ($oArtikeldetails, "product_info_v1.html") ;Artikeldetails
    
        $oArtikeloptionen = _IEFormElementGetObjByName ($oForm, "options_template") ;Artikeloptionen
        _IEFormElementSetValue ($oArtikeloptionen, "product_options_selection.html") ;Artikeloptionen
    
        $oRabatt = _IEFormElementGetObjByName ($oForm, "products_discount_allowed") ;Rabatt
        _IEFormElementSetValue ($oRabatt, 9.99) ;Rabatt
    
        $oSteuerklasse = _IEFormElementGetObjByName ($oForm, "products_tax_class_id") ;Steuerklasse
        _IEFormElementSetValue ($oSteuerklasse, 1) ;Steuerklasse
    
    
    
    
     _IEFormSubmit ($oForm)
    Endfunc
    
    #EndRegion GUI
    Alles anzeigen
  • mit "IF" Funktion mehrere Variablen ansprechen

    • AlphavibeZ
    • 31. Januar 2018 um 21:05

    Danke ihr Zwei. Verstehe das mit den Arrays so langsam etwas besser. Das mit dem auslagern ist Interessant. Ist es denn auch möglich quasi eine Art "Installer" zu generieren die dann auf den gewünschten Rechnern die Verzeichnisse mit den verschiedenen Dateien erstellt?


    LG

  • mit "IF" Funktion mehrere Variablen ansprechen

    • AlphavibeZ
    • 31. Januar 2018 um 20:05
    Zitat von alpines

    Du postest neun Zeilen Code und fragst uns wie das Problem zu lösen ist. Wie sollen wir dir denn helfen?

    Dein Code enthält keine syntaktischen Fehler und sollte laufen, die $s_hersteller2 Variable soltle auch deklariert werden, dein Problem muss also woanders liegen.

    Übrigens: Du baust einen If-Block für jede Abfrage obwohl du nur einen If-Block bräuchtest wenn du das ganze als Array implementierst.

    Hier mal ein kleines Beispiel:

    AutoIt
    Global $aHersteller[][2] = [["Bla", "http://bla"], ["Blubb", "http://blubb"], ["12345", "http://12345"]]
    
    For $i = 0 To UBound($aHersteller) - 1
        If $s_hersteller = $aHersteller[$i][0] Then
            _IENavigate($oIE, $aHersteller[$i][1])
        EndIf
    Next

    Ich würde dir dringend raten dir die AutoIt-Grundlagen nochmal anzugucken und sie durchzuarbeiten, wenn du weiter Code schreibst der zwar funktioniert aber schlecht ist, dann lernst du daraus nichts und wirst in ein paar Monaten wohl nicht mehr reinblicken und das ist bei Scripten, welche du lange verwenden möchtest, wichtig.

    Arrays gehören wirklich zu den AutoIt-Basics.

    Alles anzeigen

    Ich habe in dem Fall für jeden If-Block eine Abfrage erstellt, da ich es so übersichtlicher finde. Ich habe 54 Hersteller mit jeweils einem langen Link. Ist also mmn. wesentlich übersichtlicher das untereinander gelistet zu haben als alles in einer ewig langen Zeile. Hat es in dem Fall noch andere Vorteile, welche ich übersehe?

  • mit "IF" Funktion mehrere Variablen ansprechen

    • AlphavibeZ
    • 31. Januar 2018 um 19:17

    Hallo, ich hab leider keine Ahnung wie ich das ausdrücken soll.

    Ich möchte in einer InputBox den Namen eines Herstellers eingeben. z.B. Albert. Nun möchte ich, dass der IE aufgrund dieser Eingabe automatisch in die Kategorie des Herstellers geht und auf "neues Produkt anlegen" in dieser Kategorie clickt.

    Das mache ich so :

    Code
    if $s_hersteller = "Albert" then
            _IENavigate($oIE, "https://www.wohnkult24.com/admin/categories.php?cPath=356_361&action=new_product")
       EndIf ;1
        if $s_hersteller = "Anta" then
            _IENavigate($oIE, "https://www.wohnkult24.com/admin/categories.php?cPath=356_359&action=new_product")
        EndIf ;2

    etc.

    So, da ich ja nun schonmal die Variable $s_hersteller durch die InputBox deklariert habe, wollte ich mit dieser deklarierten Variable eine weitere deklarieren.

    z.b.

    Code
    if $s_hersteller = "Albert" then
    global $s_hersteller2 = "46"
    EndIf

    Das möchte ich tun, da in dem Formular "neues Produkt auswählen" nochmal über ein Dropdown Menü der Hersteller gewählt werden muss.

    Das funktioniert bei mir aber nicht, egal wie ich es versuche. Gibt mit sicherheit eine einfachere möglichkeit das zu machen. mit einem Array habe ich das leider nicht hinbekommen.


    Hat jemand einen Denkanstoß für mich?


    LG Alpha

  • Daten von GUI resetten und neue Daten absenden / Lösung gefunden

    • AlphavibeZ
    • 31. Januar 2018 um 14:16

    Habe es selbst gelöst bekommen.

    habe es nun so gemacht :

    Code
    gui1()
    
    Func gui1()
        global $hGUI1 = GUICreate("Artikel Anlegen", 650,550)
        global $sLagerbestand = GUICtrlCreateLabel("Lagerbestand", 20, 20)
        global $Input_lagerbestand = GUICtrlCreateInput("", 100, 20, 100, 20)
        global $sArtikelnummer = GUICtrlCreateLabel("Art. Nr.", 20, 60)
        global $Input_artnr = GUICtrlCreateInput("", 100, 60, 100, 20)
        global $sArtikelname = GUICtrlCreateLabel ("Artikelname", 20,140)
        global $Input_prodname = GUICtrlCreateInput ("", 100, 140, 100 , 20)
        global $sPreis = GUICtrlCreateLabel ("Preis", 20,180)
        global $Input_price = GUICtrlCreateInput ("", 100, 180, 100 , 20)
        global $Button_abschicken = GUICtrlCreateButton("Abschicken", 20, 260, 80, 25)
        global $Button_schliessen = GUICtrlCreateButton("Schließen", 120, 260, 80, 25)
        GUISetState()
    
        While 1
            Switch GUIGetMsg()
                Case $GUI_EVENT_CLOSE
                    ExitLoop
                Case $Button_abschicken
                     $lagerbestand = GUICtrlRead($Input_Lagerbestand)  ; Lagerbestand
                     $artnr = GUICtrlRead($Input_artnr) ; Artikelnummer
                     $artikelname = GuiCtrlRead ($Input_prodname) ; Artikelname
                     $preis = GuiCtrlRead ($Input_price) ; Preis
    
                If $lagerbestand = "" or $artnr = "" or $artikelname = "" or $preis = "" Then
                      MsgBox (0,"Info","Bitte alle Felder auswählen!")
                Else
                    _abschicken($lagerbestand, $artnr, $artikelname, $preis)
    
    
                     GUISetState (@SW_HIDE,$hGUI1)
                     gui2()
    
                     GUISetState (@SW_SHOW, $hGUI2)
                  EndIf
               Case $Button_schliessen
                  Exit 0
            EndSwitch
        WEnd
    EndFunc   ;==>gui1
    
    Func gui2()
        global $hGUI2 = GUICreate("weiteren Artikel anlegen?", 200, 200, 350, 350)
        Local $yesButton = GUICtrlCreateButton("Ja", 10, 10, 80, 30)
        Local $noButton = GUICtrlCreateButton("Nein", 10, 60, 80, 30)
        GUISetState()
    
        While 2
            Switch GUIGetMsg()
                Case $GUI_EVENT_CLOSE
                    GUIDelete($hGUI2)
                    ExitLoop
                 Case $yesButton
    
                    ; Disable the second GUI
    
                    GUISetState (@SW_HIDE,$hGUI2)
                       call ("Herstellerseite")
                   _IELoadWait($oIE,0)
                    call ("gui1")
                    GUISetState (@SW_SHOW,$hGUI1)
    
        GUISetState()
    
                 Case $noButton
                Exit 0
            EndSwitch
        WEnd
    
    EndFunc   ;==>gui2
    Alles anzeigen

    LG

  • Daten von GUI resetten und neue Daten absenden / Lösung gefunden

    • AlphavibeZ
    • 31. Januar 2018 um 10:41

    Hallo,

    ich möchte mit meinem Script automatisch Artikel für einen Onlineshop erstellen. Ich habe nun folgendes Problem :

    Ich trage die Daten über ein GUI (GUI1) ein und schicke diese ab. Diese Daten werden auch übertragen und sind im Onlineshop sichtbar. Danach öffnet sich ein neues GUI (GUI2), welches mich fragt ob ich einen weiteren Artikel anlegen möchte.

    Wenn ich auf JA drücke, öffnet sich GUI1 wieder und ich kann die Daten erneut eingeben. Allerdings werden die Daten nicht mehr übertragen. So sieht mein Code aktuell aus.

    Code
    gui1()
    
    Func gui1()
        Local $hGUI1 = GUICreate("Artikel Anlegen", 650,550)
        Local $sLagerbestand = GUICtrlCreateLabel("Lagerbestand", 20, 20)
        Local $Input_lagerbestand = GUICtrlCreateInput("", 100, 20, 100, 20)
        Local $sArtikelnummer = GUICtrlCreateLabel("Art. Nr.", 20, 60)
        Local $Input_artnr = GUICtrlCreateInput("", 100, 60, 100, 20)
        Local $sArtikelname = GUICtrlCreateLabel ("Artikelname", 20,140)
        Local $Input_prodname = GUICtrlCreateInput ("", 100, 140, 100 , 20)
        Local $sPreis = GUICtrlCreateLabel ("Preis", 20,180)
        Local $Input_price = GUICtrlCreateInput ("", 100, 180, 100 , 20)
        Local $Button_abschicken = GUICtrlCreateButton("Abschicken", 100, 260, 80, 25)
        GUISetState()
    
        While 1
            Switch GUIGetMsg()
                Case $GUI_EVENT_CLOSE
                    ExitLoop
                Case $Button_abschicken
                     $lagerbestand = GUICtrlRead($Input_Lagerbestand)  ; Lagerbestand
                     $artnr = GUICtrlRead($Input_artnr) ; Artikelnummer
                     $artikelname = GuiCtrlRead ($Input_prodname) ; Artikelname
                     $preis = GuiCtrlRead ($Input_price) ; Preis
    
                If $lagerbestand = "" or $artnr = "" or $artikelname = "" or $preis = "" Then
                      MsgBox (0,"Info","Bitte alle Felder auswählen!")
                Else
                    _abschicken($lagerbestand, $artnr, $artikelname, $preis)
    
    
                     GUISetState (@SW_HIDE, $hGUI1)
                     gui2()
                     GUISetState (@SW_ENABLE,$hGUI2)
                EndIf
            EndSwitch
        WEnd
    EndFunc   ;==>gui1
    
    Func gui2()
        Local $hGUI2 = GUICreate("weiteren Artikel anlegen?", 200, 200, 350, 350)
        Local $yesButton = GUICtrlCreateButton("Ja", 10, 10, 80, 30)
        Local $noButton = GUICtrlCreateButton("Nein", 10, 60, 80, 30)
        GUISetState()
    
        While 1
            Switch GUIGetMsg()
                Case $GUI_EVENT_CLOSE
                    GUIDelete($hGUI2)
                    ExitLoop
                Case $yesButton
                    ; Disable the second GUI
                    GUISetState(@SW_HIDE, $hGUI2)
                    gui1()
                    ; Re-enable the first GUI
                    GUISetState(@SW_ENABLE, $hGUI1)
                 Case $noButton
                Exit 0
            EndSwitch
        WEnd
    
    EndFunc   ;==>gui2
    
    
    Func _abschicken($lagerbestand,$artnr, $artikelname, $preis)
    
        $oForm = _IEGetObjById($oIE, "new_product")
    
        $oQuantity = _IEFormElementGetObjByName($oForm, "products_quantity") ; Lagerbestand
        _IEFormElementSetValue($oQuantity, $lagerbestand) ; Lagerbestand
    
        $oModel = _IEFormElementGetObjByName($oForm, "products_model") ; Artikelnummer
        _IEFormElementSetValue($oModel, $artnr) ; Artikelnummer
    
        $oName = _IEFormElementGetObjByName($oForm, "products_name[2]") ; Artikelname
        _IEFormElementSetValue($oName, $artikelname) ; Artikelname
    
        $oPreis = _IEFormElementGetObjByName ($oForm, "products_price") ; Preis
        _IEFormElementSetValue ($oPreis, $preis) ;Preis
    
    
        ; Fixe Einstellungen welche immer übermittelt werden.
    
        $oLieferzeit = _IEFormElementGetObjByName ($oForm, "shipping_status") ;Lieferzeit
        _IEFormElementSetValue ($oLieferzeit, 9) ;Lieferzeit
    
        $oVerpackungseinheit = _IEFormElementGetObjByName ($oForm, "products_vpe") ;VPE
        _IEFormElementSetValue ($oVerpackungseinheit, 1) ;VPE
    
        $oArtikeldetails = _IEFormElementGetObjByName ($oForm, "info_template") ;Artikeldetails
        _IEFormElementSetValue ($oArtikeldetails, "product_info_v1.html") ;Artikeldetails
    
        $oArtikeloptionen = _IEFormElementGetObjByName ($oForm, "options_template") ;Artikeloptionen
        _IEFormElementSetValue ($oArtikeloptionen, "product_options_selection.html") ;Artikeloptionen
    
        $oRabatt = _IEFormElementGetObjByName ($oForm, "products_discount_allowed") ;Rabatt
        _IEFormElementSetValue ($oRabatt, 10) ;Rabatt
    
        $oSteuerklasse = _IEFormElementGetObjByName ($oForm, "products_tax_class_id") ;Steuerklasse
        _IEFormElementSetValue ($oSteuerklasse, 1) ;Steuerklasse
    
    
    
    
     _IEFormSubmit ($oForm)
    Endfunc
    Alles anzeigen


    Hat jemand eine Idee, wie ich quasi GUI1 schließe und neu Lade, wenn ich bei GUI2 auf "ja" klicke?

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™