Copy link to clipboard
Copied
Dear All,
Please attached code, everything is working fine. But I want to include "Embed ICC Profile" as true while save as option. Please let me know where is the mistake.
Or, please let me know the syntax of DoScript, so that I will call the action and achieve the target.
Regards,
Rajeev
Copy link to clipboard
Copied
doScript syntax
DoScript (Action as String, From as String [, dialogs as Boolean])
Iapp.DoScript "the name of the action", "the name of the action set", False '// or True
that's the correct syntax, but I haven't been able to run it in my machine using VB, I get the following error, the object "play action" is not currently available. Try to see if you can get it to work in your.
CarlosCanto
Copy link to clipboard
Copied
Hi Carlos,
The same is not working for me also.
Any body can help us.
Regards,
Rajeev
Copy link to clipboard
Copied
The doScript syntax seems to work with AppleScript only. No one has been able to make it work with JavaScript or VB.
Copy link to clipboard
Copied
I have checked with AppleScript, but it is not working there.
Copy link to clipboard
Copied
Carlos,
Try setting another Action before running the script. I've gotten the same problem if the action I want to run is highlighted in the action panel.
Copy link to clipboard
Copied
Dear All,
Yes DoScript is working for Applescript and below is the syntax.
do script "action name" from "set name".
But my problem is still the same, we can't assign any profile using action. So for me no use of action. My code is returning the Embed ICC Profile value as true. But the properties is not getting applied on saved file.
var DestFolder, SourceFolder, Files, FileType, MyDoc, TargetFile, AISaveOpts;
//Browse for Source Folder
SourceFolder = Folder.selectDialog ("Please Select the Images files", "~");
if (SourceFolder != null)
{
Files = new Array();
Files = SourceFolder.getFiles("*.ai", "*.jpeg", "*.eps", "*.pdf");
if (Files.length > 0)
{
DestFolder = Folder.selectDialog ("Please Select the target Folder", "~");
for (i = 0; i < Files.length; i++)
{
MyDoc = app.open(Files);
TargetFile = getNewName();
AISaveOpts = getAISaveOptions();
MyDoc.saveAs (TargetFile, AISaveOpts);
MyDoc.close();
}
alert("Files are Saved as Illustrator" + DestFolder);
}
else
{
alert("No Files matching");
}
}
function getAISaveOptions()
{
var AISaveOpts = new IllustratorSaveOptions();
AISaveOpts.embedICCProfile = true;
return AISaveOpts;
}
function getNewName()
{
var ext, DocName, NewName, saveInFile;
DocName = MyDoc.name;
ext = ".ai"
NewName = "";
for (var i = 0; DocName != "."; i++)
{
NewName += DocName;
}
NewName += ext;
saveInFile = new File(DestFolder + '/' +NewName)
return saveInFile;
}
Please check where I am doing mistake.
Regards,
Rajeev
Copy link to clipboard
Copied
Hi Rajeev, your code seems correct, I was able to set up all the IllustratorSaveOptions properties, except for the one you need. In fact, I don't know how to check if it was actually embeded after running the script. at least the check box is not checked if I try to save the file again. who knows, it might be a bug.
CarlosCanto
Copy link to clipboard
Copied
I got the same result. Usually resaving the file will return the last used options for that file.
Copy link to clipboard
Copied
Larry G. Schneider wrote:
Carlos,
Try setting another Action before running the script. I've gotten the same problem if the action I want to run is highlighted in the action panel.
Hi Larry, you're a genius, it does work when the action is not highlighted.
thanks
Carlos
Find more inspiration, events, and resources on the new Adobe Community
Explore Now