Releasing Anchors of the Anchored Objects VB Script
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Releasing Anchors of the Anchored Objects VB Script
- This topic has 8 replies, 4 voices, and was last updated 5 years, 9 months ago by Loic Aigon.
-
AuthorPosts
-
-
January 11, 2016 at 7:26 am #80662
Friends,
I require to release the Anchors of the Anchored Objects and keep it in the same place in the InDesign file. I am using CS6, Windows. I like to go for VB Script. Can anyone help please?
Thank you in Advance. -
January 11, 2016 at 7:29 am #80663David BlatnerKeymaster
Does this help?
https://creativepro.com/releasing-inlines.php -
January 11, 2016 at 8:25 am #80665
Hi David,
Thank you for the quick response. I downloaded the script and ran it. It echoes the error “Please select an inline item”
Any clues? -
January 11, 2016 at 9:03 pm #80706
Hi David,
Sorry, I need to select the anchored object before running the script. I did not do and hence the issue.I selected the object and ran it. It worked fine. Thank you for that.
Now, my InDesign file has some 800 pages and many pages have many objects. So, selecting them individually and running the script is a huge task. Is there anyway to automate the same too?
I am using CS6 in Windows.
-
January 11, 2016 at 9:28 pm #80708David BlatnerKeymaster
I don’t know, sorry. Maybe this thread will help? https://forums.adobe.com/thread/932591
-
January 12, 2016 at 12:27 am #80711
Thank you David, It worked well.
^a is the key option. -
June 24, 2018 at 1:59 pm #104497Ramy RomeozMember
Please
How can I run this script ?!I opened notepad file and pasted this code in it and clicked save , closed the file
opened it and went to file , save as , changed its extension to jsx
Put it in C:\Program Files\Adobe\Adobe InDesign CC 2018\Scripts\Scripts Panel\Samples\JavaScript
restarted indesign but the code don’t run
-
June 25, 2018 at 3:04 am #104508Loic AigonMember
This might help given that you set the margins of the main thread and also set a specific object style (I like to report everything as possible on native and editable features) ;)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var main = function() {
var doc = app.properties.activeDocument, sel, docFile, m = $.os[0]==”M”,
mf = function ( f ) {return (f instanceof Folder)||/\.docx?$/i.test(f.name)},
wf = “Word files : *.doc, *.docx;”, filter = m? mf : wf;if ( !doc ) {
alert(“You need an open document” );
return;
}if ( app.selection.length!=1 || !(app.selection[0] instanceof InsertionPoint) ) {
alert(“Please select some insertionPoint and try again”);
return;
}docFile = File.openDialog(“Please open Word file…”, filter);
if ( !docFile ) return;sel = app.selection[0];
sel.place ( docFile );anchorAnswers ( doc );
}
function anchorAnswers ( doc )Â {
var fgp = app.findGrepPreferences.properties,
cgp = app.changeGrepPreferences.properties,
n = 0, found = [], nText, ip, anchored;app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.properties = {
findWhat:”#L.+\\r”,
}found = doc.findGrep();
n = found.length;
while ( n– ) {
nText = found[n];
ip = nText.insertionPoints[0];
anchored = ip.textFrames.add({geometricBounds:[0,0,60,60]});
nText.move ( LocationOptions.AT_BEGINNING, anchored.parentStory.insertionPoints[0] );
anchored.appliedObjectStyle = getObjectStyle (doc, “anchored” );
}app.findGrepPreferences.properties = fgp;
app.changeGrepPreferences.properties = cgp;
}function getObjectStyle (doc, styleName ) {
var st = doc.objectStyles.itemByName ( styleName );
!st.isValid && st = doc.objectStyles.add ({name:styleName});
return st;
}var u;
app.doScript ( “main()”,u,u,UndoModes.ENTIRE_SCRIPT, “The Script” );
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
June 26, 2018 at 2:44 pm #104547Loic AigonMember
Hello all, sorry for the submitted script. It was intended for another topic and landed here by mistake. I guess it was confusing to say the least.
Unfortunately i can’t remove it from here :P
-
-
-
AuthorPosts
- You must be logged in to reply to this topic.