main(); /*Void*/function main(){ try{ var /*Document*/doc = undefined, /*Rectangle*/r = undefined, /*TextFrame*/tF = undefined, /*File*/f = undefined; if (app.documents.length > 0){ doc = app.documents[0]; if (app.selection.length > 0){ if ((app.selection[0].constructor.name === "Rectangle") || (app.selection[0].constructor.name === "TextFrame")){ r = app.selection[0]; tF = doc.textFrames.add(); tF.texts[0].insertionPoints[-1].select(); app.paste(); file = File(tF.texts[0].parent.contents); tF.remove(); if (file.exists ){ r.place(file); } } } } } catch (error){ alert("Fehler: " + error.message + "\n" + "in Zeile: " + error.line + "\n"); } }
| 17.11.2024