Jump to content

Multi line and Tabbed lines in message box


Recommended Posts

I put couple of URLs in the clipboard. I'd like to show a messagebox that has a line followed by a line break and then all the URLs tabbed. This is what I tried but it doesn't work (the tabbing part):

$bak = ClipGet()
MsgBox(0, "Dropbox URL generator", "URL(s) that have successfully been copied in clipboard:" & @CRLF & @Tab & $bak)

the desired message box should looks like this:

the appropriate explanatory line:

http://www.autoitscript.com

http://www.autoitscript.com

http://www.autoitscript.com

is there any easy way to do this or I have to manually add a tab at the beginning of all lines of the clipboad?

Link to comment
Share on other sites

Try this:

$bak = ClipGet()
$bak = StringSplit($bak,@LF,2)
$sText = ""
For $i=0 To UBound($bak)-1
 If $bak[$i]<>@CRLF Or $bak[$i]<>@CR Or $bak[$i]<>@LF Then $sText &= @TAB & $bak[$i]&@LF
Next
MsgBox(0, "Dropbox URL generator", "URL(s) that have successfully been copied in clipboard:" & @CRLF & $sText)

[EDIT] Replaced @CRLF with @LF

Edited by taietel
Link to comment
Share on other sites

hi,

You can try something like:

$sURLs = ",www.google.com,www.autoitscript.com,www.youtube.com"
MsgBox(64, "Demo1", "The list of URLs you requested is below:" & StringReplace($sURLs, ",", @CRLF & @TAB))

Hope this helps :)

-smartee

thanks for the reply, but urls are generated by totalcommander, so I can't make them in one line separated with ","
Link to comment
Share on other sites

thank you for your replies, I found this very simple way to do this:

$bak = ClipGet()
MsgBox(64, "Demo1", "The list of URLs you requested is below:" & @CRLF & @TAB & StringReplace($bak, @LF, @TAB))
Edited by b0x4it
Link to comment
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
 Share

  • Recently Browsing   0 members

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