Plugin-Installation?

  • Hallo allerseits!

    ICh bin dabei ein größeres Projekt mir vorzunehmen: Ich möchte ein E-Mail-Programm schreiben, um zu zeigen wozu AutoIt außer Bots noch fähig ist :P

    Jetzt habe ich nur eine Frage: Wie kann man am einfachsten Plugins hinzu ziehen?

    Danke schon mal im Voraus!

    MatthiasG.

  • In den xpi-Dateien sind doch nur Java bzw. JAva-Skript -Dateien?

    Ich meine bei Gandela wäre so was möglich gewesen ?(

  • Ich habe auch mal nen e-mail programm gemacht

    vielleicht kanst du ja folgendes ja brauchen

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

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

    Global $oMyRet[2]
    Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Email versender", 396, 294)
    $Input1 = GUICtrlCreateInput("", 8, 40, 121, 21)
    $Input2 = GUICtrlCreateInput("", 248, 40, 121, 21)
    $Label1 = GUICtrlCreateLabel("Mail sever: Für http://www.web.de ist er smtp.web.de ", 8, 16, 229, 17)
    $Label2 = GUICtrlCreateLabel("Name des Absenders", 248, 16, 105, 17)
    $Label3 = GUICtrlCreateLabel("Absender email addresse", 8, 72, 122, 17)
    $Input3 = GUICtrlCreateInput("", 8, 96, 121, 21)
    $Input4 = GUICtrlCreateInput("", 248, 96, 121, 21)
    $Label4 = GUICtrlCreateLabel("Empfänger email addresse", 248, 72, 128, 17)
    $Input5 = GUICtrlCreateInput("", 8, 152, 121, 21)
    $Label5 = GUICtrlCreateLabel("Betreff", 8, 128, 35, 17)
    $Label6 = GUICtrlCreateLabel(" Text ", 248, 128, 34, 17)
    $Input6 = GUICtrlCreateInput("", 248, 152, 121, 21)
    $Label7 = GUICtrlCreateLabel("Nochmal Absender email", 8, 184, 121, 17)
    $Input7 = GUICtrlCreateInput("", 8, 208, 121, 21)
    $Input8 = GUICtrlCreateInput("", 248, 208, 121, 21)
    $Label8 = GUICtrlCreateLabel("Passwort der Absender email", 248, 184, 140, 17)
    $Button1 = GUICtrlCreateButton("Email versenden", 152, 248, 100, 25, 0)
    $Button2 = GUICtrlCreateButton("Abbrechen", 312, 256, 75, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    $rc = _INetSmtpMailCom(GUICtrlRead( $Input1),GUICtrlRead($Input2),GUICtrlRead($Input3), GUICtrlRead($Input4), GUICtrlRead($Input5), GUICtrlRead($Input6), "", "","", GUICtrlRead($Input7), GUICtrlRead($Input8))
    If @error then
    msgbox(0,"Error sending message","Error code:" & @error & " Description:" & $rc)
    EndIf
    Case $Button2
    Exit
    EndSwitch
    WEnd

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


    Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Username = "", $s_Password = "")
    $objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
    $objEmail.To = $s_ToAddress
    Local $i_Error = 0
    Local $i_Error_desciption = ""
    If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress
    If $s_BccAddress <> "" Then $objEmail.Cc = $s_BccAddress
    $objEmail.Subject = $s_Subject
    If StringInStr($as_Body,"<") and StringInStr($as_Body,">") Then
    $objEmail.HTMLBody = $as_Body
    Else
    $objEmail.Textbody = $as_Body & @CRLF
    EndIf
    If $s_AttachFiles <> "" Then
    Local $S_Files2Attach = StringSplit($s_AttachFiles, ";")
    For $ex = 1 To $S_Files2Attach[0]
    $S_Files2Attach[$x] = _PathFull ($S_Files2Attach[$x])
    If FileExists($S_Files2Attach[$x]) Then
    $objEmail.AddAttachment ($S_Files2Attach[$x])
    Else
    $i_Error_desciption = $i_Error_desciption & @lf & 'File not found to attach: ' & $S_Files2Attach[$x]
    SetError(1)
    return 0
    EndIf
    Next
    EndIf
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    ;Authenticated SMTP
    If $s_Username <> "" Then
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password
    EndIf
    ;Update settings
    $objEmail.Configuration.Fields.Update
    ; Sent the Message
    $objEmail.Send
    if @error then
    SetError(2)
    return $oMyRet[1]
    EndIf
    EndFunc;==>_INetSmtpMailCom
    ;
    ;
    ; Com Error Handler
    Func MyErrFunc()
    $HexNumber = Hex($oMyError.number, 8)
    $oMyRet[0] = $HexNumber
    $oMyRet[1] = StringStripWS($oMyError.description,3)
    ConsoleWrite("### COM Error ! Number: " & $HexNumber & " ScriptLine: " & $oMyError.scriptline & " Description:" & $oMyRet[1] & @LF)
    SetError(1); something to check for when this function returns
    Return
    EndFunc;==>MyErrFunc

    [/autoit]
  • Hey, danke Simon!

    Nur er findet eine Variable $x nicht... :)

    @ Der_Doc: Ich wollte meinen Code gleich darauf auslegen, bevor ich nachher alles ändern muss... Deshalb wollte ich wissen, was ich alles beachten muss...

  • Eine Pluginschnittstelle musst du erfinden ;)
    Dazu musst du dir überlegen, was die PlugIns können sollen und wie weit sie Zugriff auf das Programm haben sollen.

  • Und ich dachte schon was meint er nur damit :rofl:
    Aber auch hier kann dir bestimmt Pee helfen.
    Unter Projekte hier im Forum, gibt es das ganze Projet, da stehen bestimmt auch die Personen die Galenda mitentwickelt haben.

    MfG
    Der_Doc

    • Offizieller Beitrag

    Wie wurde das gelöst... ich weiß nur noch, dass ich mal dran rumgeschrieben hatte. Ob das jemals released wurde, weiß ich gar nicht :D. De facto wird es nur mit a3x-Dateien (habe ich nie verwendet) gehen, oder wenn du au3-Dateien mit der AutoIt3.exe interpretierst. Dann legst du dir eine Art Interface fest, also die Namen und Parameter der Funktionen, die du aufrufen willst und die die Plugins unterstützen müssen.
    Auf jeden Fall zuerst den Rest schreiben und wenn das läuft, dann erst über Plugins Gedanken machen ;).

    peethebee

  • Bei mir zeigt er:

    Code
    C:\Users\Matthias\Desktop\EndPointVolume\test.au3(68,31) : WARNING: $x: possibly used before declaration.
                $S_Files2Attach[$x]
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    C:\Users\Matthias\Desktop\EndPointVolume\test.au3(68,31) : ERROR: $x: undeclared global variable.
                $S_Files2Attach[$x]
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    C:\Users\Matthias\Desktop\EndPointVolume\test.au3(68,65) : ERROR: _PathFull(): undefined function.
                $S_Files2Attach[$x] = _PathFull ($S_Files2Attach[$x])
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    C:\Users\Matthias\Desktop\EndPointVolume\test.au3 - 2 error(s), 1 warning(s)