I am rather new Applescripts and for that matter any coding. I finally managed to create a working droplet that will add the color mode to the front of a dropped document name and return the document to its original location. The only problem is I need to allow my PC users access to this script through the network. I was thinking I could do this with a watched folder, but I don’t know that I am able to get the original path of the files or folders dropped on my watched folder.
I copied my droplet code below. Any help or alternate ideas would be greatly appreciated.
property extension_list : {"eps", "ai", "ps"}
on open the_Droppings
set dropped_Folders to {}
set dropped_Files to {}
repeat with a_Drop in the_Droppings
if folder of (info for a_Drop) then
set end of dropped_Folders to a_Drop
repeat with a_Folder in dropped_Folders
set source_folder to a_Folder as string
tell application "Finder"
set AllFiles to (name of every file of folder source_folder whose ¬
name extension is in (the extension_list as list))
end tell
tell application "Adobe Illustrator"
activate
repeat with i in AllFiles
set ThisDoc to ((source_folder as string) & i) as alias
try
open ThisDoc without dialogs
on error
display dialog "File " & i & " could not be opened." buttons "OK" default button 1
end try
set cSpace to color space of current document
if cSpace is RGB then
set DocTag to "RGB_"
else
set DocTag to "CMYK_"
end if
close current document saving no
tell application "Finder"
activate
select file ThisDoc
set OrgName to name of ThisDoc as text
set NewName to DocTag & OrgName as text
set name of ThisDoc to NewName
end tell
end repeat
end tell
end repeat
else
tell application "Finder"
set target_folder to (container of a_Drop) as string
set source_folder to (container of a_Drop) as string
end tell
set end of dropped_Files to a_Drop
tell application "Adobe Illustrator"
activate
try
open a_Drop without dialogs
on error
display dialog "File " & a_Drop & " could not be opened." buttons "OK" default button 1
end try
set cSpace to color space of current document
if cSpace is RGB then
set DocTag to "RGB_"
else
set DocTag to "CMYK_"
end if
close current document saving no
tell application "Finder"
activate
select file a_Drop
set OrgName to name of a_Drop as text
set NewName to DocTag & OrgName as text
set name of a_Drop to NewName
end tell
end tell
end if
end repeat
end open