var myDocument = app.activeDocument
var myTextFrame1 = myDocument.textFrames.item("TV_01");
var myTextFrame2 = myDocument.textFrames.item("TV_02");
var myTextFrame3 = myDocument.textFrames.item("TV_03");
var myTextFrame4 = myDocument.textFrames.item("TV_04");
var myTextFrame5 = myDocument.textFrames.item("TV_05");
var myTextFrame6 = myDocument.textFrames.item("TV_06");
var myTextFrame7 = myDocument.textFrames.item("TV_07");
with (app) {
if (documents.length < 1) {
alert(langNoDoc);
exit();
}
//Обрабатываем фреймы...
myPast(myTextFrame1);
myPast(myTextFrame2);
myPast(myTextFrame3);
myPast(myTextFrame4);
myPast(myTextFrame5);
myPast(myTextFrame6);
myPast(myTextFrame7);
}
alert("Скрипт завершил работу");
function myPast (myObgect){
var myFolder = "R:\\Work\\TV\\Temp\\";
var myFolder = Folder(myFolder);
if (myFolder == null) {
exit();
}
var myFiles = myFolder.getFiles();
for (myCounter = 0; myCounter < myFiles.length; myCounter++) {
if (myFiles[myCounter].constructor.name == "File") {
var myFileName = decodeURI(myFiles[myCounter].name);
myFileName = String(myFileName);
var myFindString = "<" + myFileName + ">";
var myFindResult = myObgect.search(myFindString, undefined, false);
if (myFindResult.length > 0) {
var myName = decodeURI(myFiles[myCounter]);
for (myCounter = 0; myCounter < myFindResult.length; myCounter++) {
myFindResult[myCounter].place(File(myName));
}
}
}
}
//Обнуляем свойства поиска
findPreferences = null;
}