Copy link to clipboard
Copied
Hi.
I want to import file in a text frame.
Txt file is possible. But rtf file bring up the with the code.
var FilePath = "c:/temp/txt/" + FileName;
var txtFile = new File(FilePath);
var txtFileContents;
if(txtFile.exists)
{
var txtFileOpenFlag = txtFile.open("r");
if(txtFileOpenFlag == true)
{
txtFileContents = txtFile.read();
}
}
app.selection[0].contents = txtFileContents;
How to import rtf file?
Thanks.
Hi,
While import a file there is no need to open it and read its contents (by script)
Use:
app.selection[0].place(txtFile) method
Jarek
Copy link to clipboard
Copied
Hi,
While import a file there is no need to open it and read its contents (by script)
Use:
app.selection[0].place(txtFile) method
Jarek
Copy link to clipboard
Copied
Thank you for always help. ![]()
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more