-
1. Re: An action that deletes all hidden objects
Larry G. Schneider Sep 10, 2009 3:39 PM (in response to iBabs2)Here's a script that I have to delete hidden layers in a file. It could be reworked to target page items. Remember you can only delete something if it is visible.
--get a sourceFolder that holds the files to process
set sourceFolder to (choose folder with prompt "Choose a folder with files to process:") as text-- get a list of files of the files to process in the sourceFolder
tell application "Finder" to set workingFiles to (every file of folder sourceFolder) as alias list
repeat with aFile in workingFiles
tell application "Adobe Illustrator"
open aFile
set currentFile to front document
tell application "Adobe Illustrator"
set myLayers to every layer of currentFile
repeat with i from 1 to count of items in myLayers
set myLayer to item i of myLayers
set locked of myLayer to false
if visible of myLayer is true then
set visible of myLayer to false
else if visible of myLayer is false then
set visible of myLayer to true
end if
end repeat
delete (every layer of currentFile whose visible is true)
end tell
tell application "Adobe Illustrator"
set visible of (every layer of currentFile) to true
end tell
close currentFile with saving
end tell
end repeat -
2. Re: An action that deletes all hidden objects
iBabs2 Sep 11, 2009 6:03 AM (in response to Larry G. Schneider)Hi Larry,
This script gives a message that the variable working files is not defined ?
any thoughts on that one ;-)
thanks!
babs
-
3. Re: An action that deletes all hidden objects
Larry G. Schneider Sep 11, 2009 9:11 AM (in response to iBabs2)Where and/or how are you running the script? I just tested it in AICS4 with a folder on my desktop and it worked fine. I had placed the script in the AICS4>Presets>Scripts folder. I just tried it from the script editor and it ran fine from there also.
-
4. Re: An action that deletes all hidden objects
iBabs2 Sep 11, 2009 10:12 AM (in response to Larry G. Schneider)Hi Larry....
Hmmm....I wonder if it has to do with the operating system..
I am on 10.5 on my laptop using AICS3 and it worked fine.
In the Office, we are still on 10.4...I wonder if that is what is causing the problem..
Is that possible?
thanks!!!
babs
-
5. Re: An action that deletes all hidden objects
Larry G. Schneider Sep 11, 2009 10:16 AM (in response to iBabs2)Shouldn't be a problem. Actually the script was written when I was on 10.4.9 or so. Did you run it from the ScriptEditor at the office or from the application?
-
6. Re: An action that deletes all hidden objects
iBabs2 Sep 11, 2009 10:26 AM (in response to Larry G. Schneider)I actually saved it as an .app on my desktop and double clicked it where it asks me to choose a folder.
Is there another way I should be doing this??
thanks!!!!
babs
-
7. Re: An action that deletes all hidden objects
Larry G. Schneider Sep 11, 2009 11:08 AM (in response to iBabs2)Try using
Set workingFiles to (every file of folder sourceFolder) as alias list
-
8. Re: An action that deletes all hidden objects
iBabs2 Sep 11, 2009 8:04 PM (in response to Larry G. Schneider)Hi Larry.....
I won't be able to test this till I am back in my other office and that will not be till next wednesday....
I will try it then and let you know if it works ;-)
thanks!
babs



