writing to file trouble - Adobe Indesign
This is a discussion on writing to file trouble - Adobe Indesign ; Hi,
i'm having a problem trying to write text to a plain-text file. the thing is that the script works fine if there are no 'weird' characters in the text (in my case, Lithuanian characters). any clues?
part of the ...
-
writing to file trouble
Hi,
i'm having a problem trying to write text to a plain-text file. the thing is that the script works fine if there are no 'weird' characters in the text (in my case, Lithuanian characters). any clues?
part of the script:
var myFldrName = myDoc.filePath;
var myTextName = myDoc.name.split(".indd").join("_.html");
var myFile = File(myFldrName + "/" + myTextName);
var fulltext = "";
....
myFile.open("w");
myFile.write(fulltext + "
");
myFile.close();
thanks for help in advance.
Robertas
-
Re: writing to file trouble
What you need to do immediately after opening the file is set its encoding. This is described on page 541 of the InDesign CS2 Scripting Reference under File object properties/encoding with all the encoding details on page 553. Exactly which encoding you need might take some experimentation.
Dave
-
Re: writing to file trouble
thank you Dave. but i only have InDesign Scripting Guide :/
-
Re: writing to file trouble
Which version of InDesign are you using? If CS, look in that guide in the JavaScript section under "About Files and Folders".
Dave
-
Re: writing to file trouble
utf8 has helped. once again, thank you Dave
Similar Threads
-
By Application Development in forum RUBY
Replies: 5
Last Post: 09-12-2007, 02:29 PM
-
By Application Development in forum CSharp
Replies: 6
Last Post: 08-24-2007, 05:55 AM
-
By Application Development in forum Object
Replies: 2
Last Post: 02-23-2007, 08:25 AM
-
By Application Development in forum Clarion
Replies: 3
Last Post: 04-19-2004, 09:26 AM
-
By Application Development in forum DOTNET
Replies: 2
Last Post: 01-08-2004, 06:09 AM