Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
hello, i want to create an "action droplet" in illustrator (mac os). the results i want to get as output is a vectorised ai file (outlined) and a pdf from my ai file as input. would really appreciate if you can help me out.
thx
regards,
Tesh
Copy link to clipboard
Copied
not sure what you mean with "action droplet" ... an applescript droplet doing that should be something like this:
on open fLs
repeat with file_ in fLs
tell application "Adobe Illustrator"
set file_ to POSIX path of file_
open file_
convert to paths (every text frame of document 1)
embed (every placed item of document 1)
save current document in file newFilePath as pdf with options {class:PDF save options, compatibility:Acrobat 5, preserve editability:true}
close document 1 saving no
end tell
end repeat
end open
hope it helps;
cheers;
Copy link to clipboard
Copied
To explain, in Photoshop there is an option below Batch… for Create Droplet…
File>Automate>Create Droplet…
You are given the option of taking one of your existing Actions, and creating a Droplet from it, which looks like this:
You can place this Droplet anywhere you want on your system, and whatever file you drop on this Droplet, has that set of Actions applied to it.
Here is the Droplet setup screen.
It is very convenient for repetitive actions, and it would be nice to see this implemented in Illustrator, too.
Copy link to clipboard
Copied
thanks for the clarification ... i normally program/script my own stuff so i was not aware of the dropplet option for photoshop. However this script should do what it was asked above on a mac:
on open fLs
repeat with file_ in fLs
tell application "Adobe Illustrator"
set file_ to POSIX path of file_
open file_
convert to paths (every text frame of document 1)
embed (every placed item of document 1)
save current document in file (dirname(file_) & "/export.pdf") as pdf with options {class:PDF save options, compatibility:Acrobat 5, preserve editability:true}
close document 1 saving no
end tell
end repeat
end open
on dirname(thePath)
set thePath to quoted form of POSIX path of thePath
do shell script “dirname ” & thePath
end basename
hope it helps;
cheers;
Copy link to clipboard
Copied
Okay, I found where the scripts go, but when I test this it comes back with an unexpected end of line in:
do shell script “dirname ” & thePath
Here's the error it gives:
Copy link to clipboard
Copied
It would be nice for a lot of things in scripting to be more standardised across the applications but it ain't goin to happen.
Here is my take on Sonic's AppleScript Droplet (I've gone none POSIX and used plain old HFS paths)
on open FileList
repeat with ThisFile in FileList
tell application "Adobe Illustrator"
open ThisFile
set docRef to the current document
tell docRef
set docName to name of docRef
set docPath to file path
set docParent to my getParentFolder(docPath)
set docBaseName to my getBaseName(docName)
convert to paths every text frame
embed every placed item
set newFileName to docParent & docBaseName & ".pdf"
save in file newFileName as pdf with options ¬
{class:PDF save options, compatibility:Acrobat 5, preserve editability:true}
close saving no
end tell
end tell
end repeat
end open
-- Returns a file paths parent directory as string
on getParentFolder(fPath)
tell application "Finder"
set parentFolder to container of fPath as string
end tell
return parentFolder
end getParentFolder
-- Returns the document name without extension (if present)
on getBaseName(fName)
set basename to fName
repeat with idx from 1 to (length of fName)
if (item idx of fName = ".") then
set basename to (items 1 thru (idx - 1) of fName) as string
exit repeat
end if
end repeat
return basename
end getBaseName
Copy link to clipboard
Copied
either that or ...
on open fLs
repeat with file_ in fLs
tell application "Adobe Illustrator"
open file_
convert to paths (every text frame of document 1)
embed (every placed item of document 1)
tell application "Finder" to set wDir to (get folder of file_)
save current document in file ((wDir as string) & ":export.pdf") as pdf with options {class:PDF save options, compatibility:Acrobat 5, preserve editability:true}
close document 1 saving yes
end tell
end repeat
end open
... save it as an application and drop any illustrator files on it ... it should outline your fonts and embed any images you may have ...
Choose what version fits your needs ... i tried to comply with Mark's approach as last time you encountered problems with the shell command.
hope it helps;
cheers;
Copy link to clipboard
Copied
Sweet Action!
Does exactly what Sonic says it does.
Creates a PDF with outlined fonts and embedded graphics, while leaving the original AI file "unharmed."
Copy link to clipboard
Copied
same does Mark's solution for which he deserves as much credit as I
one observation: my script does NOT leave the .ai file intact ... it saves it too as outlined ... if you want the illustrator file to remain unchanged you have to chnage the line "close ... saving yes" to "close ... saving no";
hope it helped;
cheers;
Copy link to clipboard
Copied
No disrespect intended to Mark. I just couldn't figure out how to get his to work. When I pasted it into AppleScript, it came up with errors.
Re: leaving the file "unharmed," I just rechecked, and it does. I created a new AI file, created some text, placed a graphic, saved the file, and dropped it on the App. It created a PDF with outlined text and embedded graphics. When it completed it's process, I opened up the AI file, and checked. Fonts are live, not outlined. Graphics are still linked to their location on the drive (external file server in this case). If I open the exported PDF in Illustrator, it shows fonts are outlined, and graphics are embedded. But the AI file is intact.
Copy link to clipboard
Copied
Non taken. ! easily offended as long as you have a workable solution then all is fine…
Copy link to clipboard
Copied
When I tried yours again Muppet, it worked fine. I must have done something wrong the first time.
Copy link to clipboard
Copied
One suggestion Mark ... maybe it will help you somehow:
why dun u use something like this:
on getBaseName(fName)
set basename to ""
set oDelims to Applescript's text item delimiters
set Applescript's text item delimiters to "."
if (count text items of fName) > 1
repeat with ctx from 1 to ((length of text items of fName) - 1)
set basename to basename & text item ctx of fName
end repeat
else
set basename to fName
end if
set Applescript's text item delimiters to oDelims
return basename
end getBaseName
should work a lil faster on long filenames rather than character by character approach.
hope it somehow helps;
cheers;
Copy link to clipboard
Copied
Sonic, what was in my script was an out of Adobe's AppleScript guide handler for the base name its always worked so I've never tried fix it. Although I will take a look at your mod. I've various alternatives to this. You know how things are always bogged down with the things that you can't get to work or good examples are thin on the ground leaves little time to go back over covered ground.
I've been making notes on some of your examples of JavaScript with this App.
Im glad to see that this forums activity has picked up as of late gives me more to learn from.
Or is it that now Im trying to learn JS that I look at more posts here now.
Glad that mine worked too (always very frustrating when things work for me but then not for others that be bad coding)
Copy link to clipboard
Copied
while being bored todya looking at the fresh snow getting on the tree infront of my apartments window, i thought that is somehow not fair for windows users that they cannot create droplets ... well here's a young version of something that is close to a windows droplet for illustrator, You need .NET Framework 2.0 in order to make this work:
hope it helps;
cheers;
Later edit: for the moment it works only with files(not directories - if you`ll drop a directory probably it will bark); you can set it's properties(what to run, where to save etc.) by double clicking the file, and make it run by dropping files on it;
Owh ... and for the moment runs only with CS4 installed;
Copy link to clipboard
Copied
Thanks for the hint.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Okay, but that is not really a droplet. In Photoshop you can create droplets out of your actions and it generates an miniature program that you save to your hard drive. From then on, all files dropped on that mini-program are submitted to the step outlined in the action (hence the name droplet). I've also looked for a way to do this in Illustrator CS4 and have not found a way.
Copy link to clipboard
Copied
The Batch menu item is available in AICS4 as well as CS3. You can't save it as a droplet but it can perform the action on a whole folder of files.
Copy link to clipboard
Copied
Yes, that's true, and in that sense it is useful, just not as useful as a droplet would be. The beauty of droplet is that it is set up once, and then it is available to you anytime you want to perform that action on a file (whether on a single file or a folder full of files). It's drag and drop, the way it should be.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now