this should do what you want:
//var Sel_itemPlaced = app.activeDocument.placedItems; // if nothing is selected - use the first linked file item var Sel_itemPlaced = app.activeDocument.selection; // be sure that a linked item (and not an embedded) is selected alert (Sel_itemPlaced.file.name.substr (0, 5));
What do you want to do with the text in the clipboard?
You can try the following:
But you can also write the text to a textframe in the actual or in another document. OR
You can write the text in a txt or csv file OR