script lässt sich nicht schließen

  • hi!

    hab ein kleines programm geschrieben dass, tastendrücke im freehand 9 (kartenbearbeitung) simuliert. bei der funktion, bei der das programm die tastenfolge für "text aus der zwischenablage zufügen" abschickt, friert das programm ein und lässt sich nicht mehr abschalten, wenn in der zwischenablage kein text vorhanden ist. hat jemand ne idee was ich da machen kann?

    danke im voraus!

    search

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=C:\Programme\AutoIt3\Extras\Koda\Forms\Form1.kxf
    $Form1 = GUICreate("Form1", 116, 282, 192, 124, Default, $WS_EX_TOPMOST)
    $Import = GUICtrlCreateButton("Punkte &Import", 0, 0, 115, 25, $WS_GROUP)
    $Export = GUICtrlCreateButton("Punkte &Export", 0, 24, 115, 25, $WS_GROUP)
    $Typ1 = GUICtrlCreateButton("Typ &1", 0, 48, 115, 25, $WS_GROUP)
    $Typ2 = GUICtrlCreateButton("Typ &2", 0, 72, 115, 25, $WS_GROUP)
    $Typ3 = GUICtrlCreateButton("Typ &3", 0, 96, 115, 25, $WS_GROUP)
    $Typ4 = GUICtrlCreateButton("Typ &4", 0, 120, 115, 25, $WS_GROUP)
    $Typ5 = GUICtrlCreateButton("Typ &5", 0, 144, 115, 25, $WS_GROUP)
    $Typ6 = GUICtrlCreateButton("Typ &6", 0, 168, 115, 25, $WS_GROUP)
    $Legend = GUICtrlCreateButton("Draw &Legend", 0, 192, 115, 25, $WS_GROUP)
    $Einfg = GUICtrlCreateButton("Einfügen nur &Text", 0, 216, 115, 25, $WS_GROUP)
    $Attribute = GUICtrlCreateButton("&Attribute ein", 0, 240, 115, 25, $WS_GROUP)
    $Checkbox1 = GUICtrlCreateCheckbox("I&nfo", 0, 264, 97, 17)

    [/autoit] [autoit][/autoit] [autoit]

    Dim $AccelKeys[11][2]=[["!i", $Import], ["!e", $Export], ["!1", $Typ1], ["!2", $Typ2], ["!3", $Typ3], ["!4", $Typ4],["!5", $Typ5], ["!6", $Typ6], ["!l", $Legend], ["!t", $Einfg], ["!a", $Attribute]]
    GUISetAccelerators($AccelKeys) ; "!i" = "ALT+i"
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $Import
    WinActivate("FreeHand")
    Sleep(1000)
    Send("!x")
    Sleep(500)
    Send("1")
    Sleep(500)
    Send("{UP}, {UP}")
    Sleep(500)
    Send("{ENTER}")
    Sleep(500)
    WinWaitActive("MAPublisher Import Points")
    ControlClick("MAPublisher Import Points", "Select File...", 1029)

    Case $Export
    WinActivate("FreeHand")
    Sleep(1000)
    Send("!X")
    Sleep(500)
    Send("9")
    Sleep(500)
    Send("{UP}, {UP}")
    Sleep(500)
    Send("{ENTER}")

    Case $Typ1
    WinActivate("FreeHand")
    Sleep(1000)
    Send("!x")
    Sleep(500)
    Send("5")
    Sleep(500)
    Send("S")
    WinWaitActive("MAPublisher Select by Attribute")
    ControlClick("MAPublisher Select by Attribute", "Feature", 1003)
    Sleep(500)
    Send("P")
    ControlClick("MAPublisher Select by Attribute", "Value A:", 1011)
    Sleep(500)
    Send("1")
    Sleep(500)
    ControlClick("MAPublisher Select by Attribute", "INSERT", 1021)
    Sleep(500)
    ControlClick("MAPublisher Select by Attribute", "OK", 1)

    Case $Typ2
    WinActivate("FreeHand")
    Sleep(1000)
    Send("!x")
    Sleep(500)
    Send("5")
    Sleep(500)
    Send("S")
    WinWaitActive("MAPublisher Select by Attribute")
    ControlClick("MAPublisher Select by Attribute", "Feature", 1003)
    Sleep(500)
    Send("P")
    ControlClick("MAPublisher Select by Attribute", "Value A:", 1011)
    Sleep(500)
    Send("2")
    Sleep(500)
    ControlClick("MAPublisher Select by Attribute", "INSERT", 1021)
    Sleep(500)
    ControlClick("MAPublisher Select by Attribute", "OK", 1)

    Case $Typ3
    WinActivate("FreeHand")
    Sleep(1000)
    Send("!x")
    Sleep(500)
    Send("5")
    Sleep(500)
    Send("S")
    WinWaitActive("MAPublisher Select by Attribute")
    ControlClick("MAPublisher Select by Attribute", "Feature", 1003)
    Sleep(500)
    Send("P")
    ControlClick("MAPublisher Select by Attribute", "Value A:", 1011)
    Sleep(500)
    Send("3")
    Sleep(500)
    ControlClick("MAPublisher Select by Attribute", "INSERT", 1021)
    Sleep(500)
    ControlClick("MAPublisher Select by Attribute", "OK", 1)


    Case $Typ4
    WinActivate("FreeHand")
    Sleep(1000)
    Send("!x")
    Sleep(500)
    Send("5")
    Sleep(500)
    Send("S")
    WinWaitActive("MAPublisher Select by Attribute")
    ControlClick("MAPublisher Select by Attribute", "Feature", 1003)
    Sleep(500)
    Send("P")
    ControlClick("MAPublisher Select by Attribute", "Value A:", 1011)
    Sleep(500)
    Send("4")
    Sleep(500)
    ControlClick("MAPublisher Select by Attribute", "INSERT", 1021)
    Sleep(500)
    ControlClick("MAPublisher Select by Attribute", "OK", 1)

    Case $Typ5
    WinActivate("FreeHand")
    Sleep(1000)
    Send("!x")
    Sleep(500)
    Send("5")
    Sleep(500)
    Send("S")
    WinWaitActive("MAPublisher Select by Attribute")
    ControlClick("MAPublisher Select by Attribute", "Feature", 1003)
    Sleep(500)
    Send("P")
    ControlClick("MAPublisher Select by Attribute", "Value A:", 1011)
    Sleep(500)
    Send("5")
    Sleep(500)
    ControlClick("MAPublisher Select by Attribute", "INSERT", 1021)
    Sleep(500)
    ControlClick("MAPublisher Select by Attribute", "OK", 1)


    Case $Typ6
    WinActivate("FreeHand")
    Sleep(1000)
    Send("!x")
    Sleep(500)
    Send("5")
    Sleep(500)
    Send("S")
    WinWaitActive("MAPublisher Select by Attribute")
    ControlClick("MAPublisher Select by Attribute", "Feature", 1003)
    Sleep(500)
    Send("P")
    ControlClick("MAPublisher Select by Attribute", "Value A:", 1011)
    Sleep(500)
    Send("6")
    Sleep(500)
    ControlClick("MAPublisher Select by Attribute", "INSERT", 1021)
    Sleep(500)
    ControlClick("MAPublisher Select by Attribute", "OK", 1)

    Case $Legend
    WinActivate("FreeHand")
    Send("!x")
    Sleep(500)
    Send("3")
    Sleep(500)
    Send("D")

    Case $Einfg
    WinActivate("FreeHand")
    Send("!b")
    Sleep(500)
    Send("F")
    WinWaitActive("Inhalte einfügen")
    Send("N")
    Sleep(500)
    Send("{ENTER}")

    Case $Attribute
    WinActivate("FreeHand")
    Send("!x")
    Sleep(500)
    Send("8")
    Sleep(500)
    Send("{ENTER}")


    Case $GUI_EVENT_CLOSE
    Exit

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit]

    Einmal editiert, zuletzt von search247 (24. September 2009 um 15:21)

  • Hallo search247,

    welches Prgramm friert ein, dein AutoIt-Skript oder freehand 9? Du könntest ja in deinem Skript überprüfen ob etwas in der Zwischenablage ist und wenn nicht eine MsgBox ausgeben.

    [autoit]

    $bak = ClipGet()
    if $bak ="" then
    MsgBox(64,"Zwischenablage","ist leer")
    Else
    .... ; Funktionen zum einfügen
    EndIf

    [/autoit]

    mfg (Auto)Bert

    @kloklo man kann seine Posts auch editieren, einfach auf bearbeiten drücken

    Einmal editiert, zuletzt von AutoBert (24. September 2009 um 15:13)