Have you tried using the excellent Adobe forum for InDesign scripting. It includes all aspects of scripting, including AS. It has been an invaluable resourse for me in the past few years.
That’s a lot of stuff you want it to do, how much ya paying for it? Or do you expect someone to spend their time to create something so that you can get a promotion at work?
I have tried it on Adobe Forum. But nobody has answered me.
Dear Jerome : It is not part of my work, it’s my own interest to do it. It won’t help me to get promotion. My promotion came through what production my team has given, what revenue I have earned for my company.
By the way I have develop this script for Font checking:
tell application "Adobe InDesign CS2"
set theDoc to the front document
tell theDoc
set thetype to font type of every font
if thetype is in {OpenType CFF, OpenType CID, OpenType TT} then
display dialog "Open Type Font"
else
display dialog "Post Script Font"
end if
end tell
end tell
But it has some problem, if I used both OpenType and PostScript Font then it show only “Post Script Font” dialog. I know what mistake I am making, and I am trying to resolve it.
Some more progress in it, but unable to check if both fonts are used in theDoc
tell application "Adobe InDesign CS2"
set theDoc to the front document
tell theDoc
set theFontList to name of every font as text
set TotalFont to count of every font
display dialog "Tolat Fonts are : " & TotalFont
repeat with i from 1 to TotalFont
set FontName to get name of font i as text
display dialog "The Name of the fonts are : " & FontName
end repeat
set thetype to font type of every font
if thetype is in {OpenType CFF, OpenType CID, OpenType TT} then
display dialog "Open Type Font"
else
display dialog "Post Script Font"
end if
end tell
end tell
Pooja,
If my assessment is wrong my appologies, however it appeared that you were posting a laundry list of specs for a script with no attempt at doing any of the work yourself. There are people on these boards that make money programing, and graciously help out when something is posted, but one should not expect to have everything handed to them. If you have a problem there are a lot of people who will answer what they can, I have answered some of your questions earlier so you know I don’t have a problem doing so. If you can’t find it on ScriptBuilders, and don’t or can’t post a project on MacDeveloper then get the project started and post a question when you run into a problem, someone will help if they can.
On to your problem, I’m not sure how you ultimatly want the reporting of the fonts, but this shoud work for stepping through the font list and telling the name and type of font that is in the document based off of your parameters. I took the liberty of eleminating some redundancy and using the object reference to call directly to the document to get the information.
tell application "InDesign CS"
set theDoc to the front document
tell theDoc
set theFontList to every font
display dialog "Total Fonts are : " & (count of theFontList)
repeat with i from 1 to count of theFontList
set FontName to name of item i of theFontList
set thetype to font type of item i of theFontList
display dialog "The Name of the font is: " & FontName
if thetype is in {OpenType CFF, OpenType CID, OpenType TT} then
display dialog "Open Type Font"
else
display dialog "Post Script Font"
end if
end repeat
end tell
end tell
Don’t wothered man, I know this fact. Below I have developed it with the help of Stanley on Adobe Forum. I have still some problem, it will help me if you can check it.
tell application "Adobe InDesign CS2"
set theDoc to the front document
tell theDoc
set theFontList to name of every font as text
set TotalFont to count of every font
display dialog "Tolat Fonts are : " & TotalFont
repeat with i from 1 to TotalFont
set FontName to get name of font i as text
display dialog "The Name of the fonts are : " & FontName
end repeat
-- set Tenp to (count of every font of font type) is in {OpenType CFF, OpenType CID, OpenType TT}
-- display dialog Tenp
set thetype to font type of every font
repeat with i from 1 to count of items of thetype
if item i of thetype is in {OpenType CFF, OpenType CID, OpenType TT} then
set nm to display dialog (item i of theFontList) & " : is an Open Type Font" default button 1 buttons {"Ok", "Delete"}
set nm to text returned of nm
set nm to nm as text
if text returned is "Delete" then
delete item i of theFontList
end if
else
display dialog (item i of theFontList) & " : is an Post Script Font"
end if
end repeat
--To Check missing fonts or installed fonts
set FontStatus to font type of every font
if FontStatus is not installed then
display dialog "Fonts are missing"
else
display dialog "Fonts are installed"
end if
end tell
end tell
I am unable to delete the font.
I am unable to show missing fonts.
How can I check parsing error of xml in InDesign document
For XML Validation I am writting the below code, but it still not working.
tell application "Adobe InDesign CS2"
set theDoc to the front document
tell theDoc
if validation errors is true then
display dialog "Error Exist"
else
display dialog "No Error Exist"
end if
end tell
end tell
What are you trying to delete the fonts from, the document or the list. Right now it looks like you are trying to delete the Open Type fonts from the font list. If you want to delete them from the document you will have to take another approach. Your script looks very combersome to the user with all the dialog boxes. What is the real goal, to get rid of the Open Type fonts or make a report of the fonts? Or is our goal something else entirely. If it is to eleminate fonts then it appears to me that using the built in Find Font would be faster than wading through all those dialog boxes. If you are looking to build a list of post script fonts then you should be able to do this without all the boxes as well. Also look at InDesign’s GUI functions to build dialog boxes that are a lot more flexable, I’ll try to post an example a little later.
On the XML, I havent done much with XML and InDesign. If I have some time I will take a look.
A lot of stuff you want to do greate going, I am working on the same type of projects. Deletion of font is not possible , when you will delete any font then it will ask for replacement. Or get the file path of that font and then if it is activated then first deactivate that font and say delete from list.