Jump to content

Recommended Posts

Posted

Hi

I am coding a script so that i can replace any given character which will be present in the clipboard, with any character. the script is here.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_Comment=oDx
#AutoIt3Wrapper_Res_Description=- obscurant1st.biz
#AutoIt3Wrapper_Res_Fileversion=1.0.0.3
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ClipBoard.au3>
Dim $text, $toberplcd, $rplcwith, $modText
MsgBox(0,"Info","Copy the Text to ClipBoard!!!")
$text = _ClipBoard_GetData($CF_TEXT)
$toberplcd = InputBox("Replace","enter the string to be replaced:")
$rplcwith = InputBox("Replace","enter the Replacement string:")
$modText = StringReplace($text,$toberplcd,$rplcwith)
_ClipBoard_SetData($modText)

But here when i try to replace any character lets say ";" with @CRLF it simply replaces the ; by @CRLF, but i need the new line character, so that when i paste the content of the clipboard, all ; will become new lines. So is there any way of doing this. I mean is there any way of replacing a character with new line character?

Posted

Here's what i got so far:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_Comment=oDx
#AutoIt3Wrapper_Res_Description=- obscurant1st.biz
#AutoIt3Wrapper_Res_Fileversion=1.0.0.3
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ClipBoard.au3>
Dim $text, $toberplcd, $rplcwith, $modText
MsgBox(0,"Info","Copy the Text to ClipBoard!!!")
$text = _ClipBoard_GetData($CF_TEXT)
$toberplcd = InputBox("Replace","enter the string to be replaced:")
$rplcwith = StringReplace(InputBox("Replace","enter the Replacement string:"),"@CRLF",@CRLF)
$modText = StringReplace($text,$toberplcd,$rplcwith)
_ClipBoard_SetData($modText)

Hi ;)

Posted

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_Comment=oDx
#AutoIt3Wrapper_Res_Description=- obscurant1st.biz
#AutoIt3Wrapper_Res_Fileversion=1.0.0.3
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <ClipBoard.au3>
Dim $text, $toberplcd, $rplcwith, $modText
MsgBox(0,"Info","Copy the Text to ClipBoard!!!")
$text = _ClipBoard_GetData($CF_TEXT)
$toberplcd = InputBox("Replace","enter the string to be replaced:")
$rplcwith = InputBox("Replace","enter the Replacement string:")
$rplcwith = StringReplace($rplcwith,"@CRLF",@CRLF)
$modText = StringReplace($text,$toberplcd,$rplcwith)
_ClipBoard_SetData($modText)

Posted (edited)

  On 2/3/2010 at 6:50 AM, 'Mison said:

$rplcwith = StringReplace(InputBox("Replace","enter the Replacement string:"),"@CRLF",@CRLF)

That thing worked lyk a charm, thx man.. :D

lainline thank you too.. :huggles:

Edited by obscurant1st
Posted

  On 2/3/2010 at 6:59 AM, 'obscurant1st said:

That thing worked lyk a charm, thx man.. :huggles:

lainline thank you too.. :

You're welcome. :D

Hi ;)

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...