Substitute selection by a file
Posted: 2010-06-25 02:40:19
I made a macro, its simple one.
The purpose of this macro is "Select region to substitute by a file".
However, it has a problem.
When the text inserted, there are unexpected texts are added to front and end of the inserted text.
Front one is ("
End one is ", "", "")
I hope to know the reason of the unexpected result and I'd like to make a macro which I expected.
Please help me.
Code: Select all
$doc1 = Document.active
$file = Choose File '~/Documents', 'Choose File to insert'
$doc2 = Document.open $file
$text = $doc2.allTexts
Document.setActive $doc1
$doc1.insertText $text, 'm'
However, it has a problem.
When the text inserted, there are unexpected texts are added to front and end of the inserted text.
Front one is ("
End one is ", "", "")
I hope to know the reason of the unexpected result and I'd like to make a macro which I expected.
Please help me.