Jump to content
Sign in to follow this  
SkysLastChance

Formating Question - Notepad [Solved]

Recommended Posts

Run("notepad.exe")

GLOBAL $One = ('Line1' & _
    'Line2' & _
    'Line3' & _
    'Line4' & _
    'Line5')



      ClipPut($One)

      $Notepad = WinWait("[CLASS:Notepad]", "", 10)
      ControlSend("Untitled - Notepad", "", "", ("^v"))

Instead of having this paste as Line1Line2Line3Line4Line5

How can I make it paste it into notepad as (without double spacing.)

Line1

Line2

Line3

Line4

Line5

Edited by SkysLastChance

Life's simple. You make choices and you don't look back.

Share this post


Link to post
Share on other sites

Thank you for the quick response. 

Run("notepad.exe")

GLOBAL $One = ('Line1' & _
      @CRLF
    'Line2' & _
      @CRLF
    'Line3' & _
      @CRLF
    'Line4' & _
      @CRLF
    'Line5')



      ClipPut($One)

      $Notepad = WinWait("[CLASS:Notepad]", "", 10)
      ControlSend("Untitled - Notepad", "", "", ("^v"))

Like this?

I am getting this error. 

>"J:\Temporary Files\\AutoIt\AutoIt\AutoIt\SciTe\..\autoit3.exe" /ErrorStdOut "C:\Users\\Desktop\test.au3"    
"C:\Users\\Desktop\test.au3" (3) : ==> Missing right bracket ')' in expression.:
GLOBAL $One = ('Line1' & @CRLF
GLOBAL $One = ^ ERROR
>Exit code: 1    Time: 0.2167

 


Life's simple. You make choices and you don't look back.

Share this post


Link to post
Share on other sites

That did the trick thank you!

 

Run("notepad.exe")

GLOBAL $One = ('Line1' & @CRLF & _
    'Line2' & @CRLF & _
    'Line3' & @CRLF & _
    'Line4' & @CRLF & _
    'Line5')



      ClipPut($One)

      $Notepad = WinWait("[CLASS:Notepad]", "", 10)
      ControlSend("Untitled - Notepad", "", "", ("^v"))

 


Life's simple. You make choices and you don't look back.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Bhooshan
      I need to mute an ongoing call on Microsoft teams without activating the window. Teams allows us to mute using shortcut key Ctrl+Shift+m but only when the window is active.
      # Used set option as ongoing call can be with any person which leads to change in Title Name.
      AutoItSetOption ( "WinTitleMatchMode", 2 ) 
      # I am not clear with the control ID which will be good to use here and also the key combination of ^M       
      ControlSend ( "Microsoft Teams", "", "[CLASS:Intermediate D3D Window; INSTANCE:1]", "{ctrl down}")
       
      Can anyone help...!!! 
       

    • By Fadi
      Hi i'm trying to create a ClipPut with differents font size and font and then paste it into word document.
      I know in Word document, i can send("^+P") and change the font size, but it's not then best way to do if i have to change the font and size many time in the document.
          ShellExecute("ReportTemplate.doc")
          WinActivate("ReportTemplate.doc [Compatibility Mode] - Word")
          WinWaitActive("ReportTemplate.doc [Compatibility Mode] - Word")
          Sleep (1000)
          ClipPut("Underline Size 16: " & "Bold size 12" & "Normcal size 11")
          Send("^v")
      Any idea?
       
       
    • By diff
      Hello,
      still learning and trying to understand AutoIT but having problem in filling my PDF file.
       
      So my code looks like similar to this:
      Global $1 = "text text 44444444" Global $2 = "texting2 texting2" Global $3 = "newtext3 next3" ShellExecute ("C:\Users\XXX\Desktop\myPDF.pdf") WinWaitActive("MyPDF.pdf - Adobe Acrobat Reader DC") Send ("{TAB}") ClipPut($1) Send ("^v") Send ("{TAB 3}") ClipPut($2) Send("^v") Send ("{TAB}") ClipPut($3) Send("^v") So its fill my PDF form, the first field looks good, the code add the text text 4444, then second should be $2 with texting2 texting2 but for some reason the code uses for second and third field after TAB only variable $3.
      So, I receive in $2 and $3 for some reason same newtext3 next3 in both, why its skipping the variable $2? Maybe there also much better solution for instant text? Because Send writes with delay by letters which I don't like.
      Thanks!
    • By AZJIO
      My Notepad v0.4 (En, Ru)

      Black theme

       
      My_Notepad.7z (560kb sources + EXE)
       
      I wanted to make an example for the help file. But I could not stop, and made more complicated.
    • By SkysLastChance
      What am I doing wrong here. 
      I am trying to get a list of names in the clip that look like
      Bob
      Greg
      James
      Kevin
      Etc...
      I have tried
      ClipPut("Bob" & @CRLF & "Greg" & @CRLF & "James" & @CRLF & "Kevin" & @CRLF & "Tim" & @CRLF & "Kelly" & @CRLF & _ "Susan"_& @CRLF & "Bill" & @CRLF & "Maggie" & @CRLF & "Amanda" & @CRLF & "Matt" & @CRLF & "Robert" & @CRLF & "Sara" & @CRLF & _ "Zach" & @CRLF) and
      ClipPut("Bob" & @CRLF & "Greg" & @CRLF & "James" & @CRLF & "Kevin" & @CRLF & "Tim" & @CRLF & "Kelly" & @CRLF & _ & "Susan"_& @CRLF & "Bill" & @CRLF & "Maggie" & @CRLF & "Amanda" & @CRLF & "Matt" & @CRLF & "Robert" & @CRLF & "Sara" & @CRLF & _ & "Zach" & @CRLF)  
×
×
  • Create New...