Have an account? Sign in
"*" indicates required fields
You agree that CreativePro Network may send you emails, including the newsletter selections above. You can unsubscribe at any time.
By signing in, you agree to our Terms of Use and acknowledge our Privacy Notice.
New user? Create an account
By signing in, you agree to our Terms of Use and acknowledge our Privacy Notice.
Ah right just looked up catch(err) am I correct in thinking it supresses any javascript errors?
The script is running well, though I seem to have a slight glitch.
Currently the indesign documents relinks embedded linked files to a new file location. The indesign document consists of two links to multi page pdf's with 4 instances each across the document (8 links in total).
Some times the script runs and only two links remain embedded whilst another time the script may leave four links embedded. Is this something to do with a time out of the script? It seems to execute for several seconds then gives up re-linking.
Would it be possible to add a function that loops the link.update(); until all links are re-linked?
iv
Thank you Kasyan, your help is greatly appreciated.
The directory slashes seem to happen when copying and pasting from extendscript to the forum, it also seems to change the script 'i–'.
Would it be possible to talk me through the script and its actions. This is as how I understand it:
#target indesign = targets indesign application
var i, link, newFile, = specifies variables
doc = app.activeDocument, = specifies the active document as the file name
links = doc.links, = name of all the links in the file
newPath = “/c/temp/newproject/”; = new path string
for (i = links.length-1; i >= 0; i–) { = loops through each link in links from 0 to infinity
link = links[i]; = each link in the loop is a seperate string
newFile = new File(newPath + link.name); =concatenates path and file name to create new file
if (newFile.exists) link.relink(newFile); = loops throguh and relinks files
try {
link.update(); = update links
}
catch(err) {}
}
Was just wondering why you have to use 'try { }' and 'cath(err){}'.
Regards,
Iv
This site uses cookies, but not the kind you eat. We use cookies to remember log in details, provide secure log in, improve site functionality, and deliver personalized content. By continuing to browse the site, you accept cookies.