Jump to content

Recommended Posts

Posted (edited)

Hello guys,

I have two problems.

At first I try to enter a new line, but it dosn't work and I try to enter a tab and it dosn't work, too.

attatched my script. 

$vorname = InputBox ( "Vorame", "Bitte den Vorname eingeben.") ; Vorname eingeben
$nachname = InputBox ( "Nachname", "Bitte den Nachname eingeben.") ; Nachname eingeben
$kuerzel = InputBox ( "Kuerzel", "Bitte das Kuerzel eingeben.") ; Kuerzel eingeben
$position = InputBox ( "Position", "Bitte die Position eingeben.") ; Position eingeben
$durchwahl = InputBox ( "Durchwahl", "Bitte die Durchwahl eingeben.") ; Druchwahl eingeben
$handy = InputBox ( "Handynummer", "Bitte die Handynummer, im Format +49 160 1234567 eingeben. Wenn keine Handynummer vorhanden ist, eine Nein eintragen.") ; Handynummer eingeben
$email = $vorname&'.'&$nachname&'@test.de'

$file = FileOpen("path\SignaturAntwort.htm", 0)

; Check if file opened for reading OK
If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf

; Ersetze Suchstring durch Eingaben
$chars = FileRead($file)
$chars=stringreplace($chars,"#Vorname#",$vorname)
$chars=stringreplace($chars,"#Nachname#",$nachname)
$chars=stringreplace($chars,"#Position#",$position)
If $handy = "Nein" Then
        $chars=stringreplace($chars,"#Durchwahl#",$durchwahl)
        $chars=stringreplace($chars,"#Handy#","")
    Else
        $chars=stringreplace($chars,"#Durchwahl#",$durchwahl@CRLF)
        $chars=stringreplace($chars,"#Handy#",'Mobil'@TAB&$handy)
EndIf
$chars=stringreplace($chars,"#Mail#",$email)
filewrite('path\'&$kuerzel&'_Antwort.htm', $chars)

FileClose($file)

Best regards

MrDTeach

Edited by Jos
Just put the code in the post in stead of attachment
  • Developers
Posted (edited)
  On 9/2/2019 at 11:33 AM, MrDTeach said:

$durchwahl@CRLF

Expand  

should be:

$durchwahl & @CRLF

..and ...

  On 9/2/2019 at 11:33 AM, MrDTeach said:

'Mobil'@TAB&$handy

Expand  

should be:

'Mobil' & @TAB & $handy

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

You mean there is a & @crlf missing after your Telefonnummer?

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Posted

Do you view your file in a browser? Maybe then you need to use html tags like <br>

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

  • Developers
Posted (edited)

Like @Xenobiologist states: Those characters are there but won't be shown in any browser program as HTML doesn't support TAB en CRLF.
Open the file in SciTE or Notepad and you will see they are there.

Jos

 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

I edit 3 files for the Outlook signature. 
.HTM, .RTF, and .TXT
 

<br> works for HTM. Thanks :)

Now I need a option for the other two Files.

Do you know the characters for the tabulator? 

  • Developers
Posted
  On 9/2/2019 at 12:16 PM, MrDTeach said:

Do you know the characters for the tabulator? 

Expand  

There is no HTML alternative for TAB. Commonly they use <Table> when things need to be aligned. 
Just play with these files manually until you have the appropriate formatted text figured out and then you make the Logic in AutoIt3 to do that automatically. ;)  

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...