noob needs macro assistance..
Submitted by Friday, 30 December, 2011 - 03:20
on
Hi,
i'd appreciate if someone could help me on this nobrainer.. (well not for me obviously :
I'd like to grab some selected text, or if none is selected, the content of the clipboard,
and then do some search/replace, add some text, and paste back to the textarea..
my approach so far:
var = textArea.getSelectedText();
if(var.length == 0){
// get text from clipboard & assign to var..
// Registers.cut(textArea,'$'); does get the clipboard, but i just don't know how to assign it to var..
}
esc_var = var.replaceAll("'", "\"");
textArea.setSelectedText("FB::log("+var+",'"+esc_var+"');");
cheers & thx..
jc
i'd appreciate if someone could help me on this nobrainer.. (well not for me obviously :
I'd like to grab some selected text, or if none is selected, the content of the clipboard,
and then do some search/replace, add some text, and paste back to the textarea..
my approach so far:
var = textArea.getSelectedText();
if(var.length == 0){
// get text from clipboard & assign to var..
// Registers.cut(textArea,'$'); does get the clipboard, but i just don't know how to assign it to var..
}
esc_var = var.replaceAll("'", "\"");
textArea.setSelectedText("FB::log("+var+",'"+esc_var+"');");
cheers & thx..
jc