Identify MathType eps
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / Identify MathType eps
- This topic has 4 replies, 2 voices, and was last updated 6 years, 9 months ago by Bala S.
-
AuthorPosts
-
-
July 21, 2017 at 8:51 am #96246Bala SParticipant
I have tried a script to identify MathType eps from an InDesign document and want to rename. By using this function, I could find all eps (even illustrator eps file), but I need to find MathType eps alone. Can anyone help me?
function imgRenameProcess()
{
var myDoc=app.activeDocument;
var myLink = myDoc.links;
for(var i=0;i<myLink.length;i++)
{
count=count+1;
var imgname=myLink[i].name;
var imgExt = imgname.substr(imgname.lastIndexOf(“.”) ,imgname.length);if (imgExt == “.eps”)
{var myLinkFile = File(myLink[i].filePath);
var newname= myUsrInput + count+imgExt;
myLinkFile.rename(newname);
myLink[i].relink(myLinkFile);
myLink[i].update();
}
}}
-
July 21, 2017 at 10:03 am #96247Mike DeanMember
Our MathType EPS files have the creator application name stored in the XMP metadata (we’re on MathType 6.9b), and it looks like you can check the XMP data from within InDesign.
So, from within your loop, you should be able to check the creator application for each link using:
myLink[i].linkXmp.creator;If it’s a MathType EPS, the creator property should be “MathType” (at least, that’s what it’s returning for me).
-
July 21, 2017 at 11:36 am #96249Bala SParticipant
Hi Mike Dean,
Thanks for your info. However unfortunately I have Math Type Version 6.7a and I am getting the error “No Metadata information available”.
Is there any other way to find out in this version?
-
July 21, 2017 at 12:06 pm #96250Mike DeanMember
Hmm, the only other thing I can think of is to read the contents of EPS file (the metadata should be plain text). If you open a MathType file in Notepad, do you see a line like this near the top?
%%Creator: MathTypeIf that’s present in a MathType 6.7a file, then you should be able to read the EPS file with a script as discussed in this Adobe forum thread:
https://forums.adobe.com/thread/472724Hope that helps!
-
July 25, 2017 at 2:06 am #96334Bala SParticipant
Hi Mike Dean,
Thank you so much for your guidance to resolve my issues. Now everything works fine!
-
-
AuthorPosts
- You must be logged in to reply to this topic.