Copy link to clipboard
Copied
Before:
After:
… One light-saber hit! …
… Nothing seems to have happened!
Just use The Force!
.../*
Script wrtitten by Michel Allio (aka Obi-wan Kenobi) [2017/01/14]
See: https://forums.adobe.com/thread/2263331
*/
app.doScript("main()", ScriptLanguage.javascript, undefined, UndoModes.FAST_ENTIRE_SCRIPT, "Anchor Text Selection! …");
function main()
{
try {
var myOStyle = app.activeDocument.objectStyles.item("mySel");
myOStyle.name;
} catch (e) {
var myOStyle = app.activeDocument.ob
Copy link to clipboard
Copied
You show us an anchored item, your question is not that clear: what exactly do you want?
Copy link to clipboard
Copied
Before: I select text. After: New textframe and into the selected text
Copy link to clipboard
Copied
Select the text.
Cut it from the text frame.
Deselect the text frame.
Choose Paste.
Adjust the new text frame to see all the text.
Click where you want the text to be.
Choose Paste.
HOWEVER if you don't mind losing the text as text, select the text.
Choose Create Outlines from the Type menu
The text will be converted to an object in the text flow.
Copy link to clipboard
Copied
… One light-saber hit! …
… Nothing seems to have happened!
Just use The Force!
/*
Script wrtitten by Michel Allio (aka Obi-wan Kenobi) [2017/01/14]
See: https://forums.adobe.com/thread/2263331
*/
app.doScript("main()", ScriptLanguage.javascript, undefined, UndoModes.FAST_ENTIRE_SCRIPT, "Anchor Text Selection! …");
function main()
{
try {
var myOStyle = app.activeDocument.objectStyles.item("mySel");
myOStyle.name;
} catch (e) {
var myOStyle = app.activeDocument.objectStyles.add({name: "mySel", enableFill: false, enableStroke: false});
}
var mySel = app.selection[0],
myLeading = mySel.leading,
myFrame = mySel.insertionPoints[-1].textFrames.add();
mySel.characters.itemByRange(0, mySel.characters.length-2).move (LocationOptions.after, myFrame.insertionPoints[0]);
myFrame.textFramePreferences.autoSizingType = AutoSizingTypeEnum.HEIGHT_AND_WIDTH;
myFrame.textFramePreferences.useNoLineBreaksForAutoSizing = true;
myFrame.insertionPoints[0].leading = myLeading;
myFrame.applyObjectStyle(myOStyle);
}
// _____ (^/) _____ \\
… and join The Rebellion!
(^/)
Copy link to clipboard
Copied
I second Frans: what's the final goal of all this? What do you expect to gain? Isn't it just another incarnation of the famous 'xy problem"?
Copy link to clipboard
Copied
Thank you so much by Obi-wan