AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

StringReplace comma in Clipboard still output (html char44)

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
VibrantLife



Joined: 29 Oct 2009
Posts: 50

PostPosted: Mon Feb 22, 2010 8:22 pm    Post subject: StringReplace comma in Clipboard still output (html char44) Reply with quote

When i use StringReplace to get rid of
comma's from a string in the Clipboard.

Like: This comma, should be removed

It output like: This comma&#44 should be removed.

The server which recieves this input from the Web form chokes on it,
with a server error in Internet explorer because it doesn't expect and accept html code.

code:

Code:
name:=iWeb_getDomObj(pwb,"name")
Clipboard:=name
StringReplace, Clipboard, Clipboard, `,,, ALL
Send, {CtrlDown}v{CtrlUp}


when i use:

Code:
Send, {CtrlDown}a{CtrlUp}{CtrlDown}c{CtrlUp}
StringReplace, Clipboard, Clipboard, `,,, ALL
Send, {CtrlDown}v{CtrlUp}


It removes the comma's just fine.

What is causing this?

PS: i need to use the Clipboard for this,
Because the Web Form in Iexplorer doesn't save the
iWeb_setDomObj
_________________
The signature is away at the moment, please leave a message after the beep...
Back to top
View user's profile Send private message
Guest






PostPosted: Mon Feb 22, 2010 8:27 pm    Post subject: Reply with quote

What is the contents of "name" - ie:
Code:
MsgBox, % name:=iWeb_getDomObj(pwb,"name")
Back to top
Leef_me



Joined: 08 Apr 2009
Posts: 5336
Location: San Diego, California

PostPosted: Mon Feb 22, 2010 8:31 pm    Post subject: Reply with quote

I don't understand the web code but I wonder if another debugging tool would help.

Code:

name:=iWeb_getDomObj(pwb,"name")
listvars ; <---- this brings up a separate window showing program variables
msgbox before clipboard copy ; <--close the msgbox to continue the program
Clipboard:=name
listvars ; <--- this will update the previous windown shown by listvars.
msgbox after clipboard copy
StringReplace, Clipboard, Clipboard, `,,, ALL
Send, {CtrlDown}v{CtrlUp}
Back to top
View user's profile Send private message
VibrantLife



Joined: 29 Oct 2009
Posts: 50

PostPosted: Mon Feb 22, 2010 8:39 pm    Post subject: Reply with quote

Anonymous wrote:
What is the contents of "name" - ie:
Code:
MsgBox, % name:=iWeb_getDomObj(pwb,"name")


The content are random names of company's with comma's like:
Petrol, oil company

I just like to remove the comma, but the output result in :

Petrol&#44 oil company
_________________
The signature is away at the moment, please leave a message after the beep...
Back to top
View user's profile Send private message
sinkfaze



Joined: 18 Mar 2008
Posts: 5043
Location: the tunnel(?=light)

PostPosted: Mon Feb 22, 2010 8:42 pm    Post subject: Reply with quote

iWeb_getDomObj has a built-in portion of its code that converts all commas to their character entity equivalent, which is &#44 ;. tank would be better fit to explain the rationale behind adding this functionality than I, but nonetheless that is why you're seeing that come up. Since AHK is (or should be) eating the semicolon once passed to the variable you'll want to use this to remove the 'comma':

Code:
StringReplace, Clipboard, Clipboard, &#44, , All

_________________
Try Quick Search for Autohotkey or see the tutorial for newbies.
Back to top
View user's profile Send private message Send e-mail
VibrantLife



Joined: 29 Oct 2009
Posts: 50

PostPosted: Mon Feb 22, 2010 8:51 pm    Post subject: Reply with quote

sinkfaze wrote:
iWeb_getDomObj has a built-in portion of its code that converts all commas to their character entity equivalent, which is &#44 ;. tank would be better fit to explain the rationale behind adding this functionality than I, but nonetheless that is why you're seeing that come up. Since AHK is (or should be) eating the semicolon once passed to the variable you'll want to use this to remove the 'comma':

Code:
StringReplace, Clipboard, Clipboard, &#44, , All


Ah muchos gracias! Very Happy
_________________
The signature is away at the moment, please leave a message after the beep...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group