PDA

View Full Version : Applescriprit


Piter77
22-10-2007, 16:51
Ciao a tutti,
ho un problemino, avevo un actionscript che mi trasformava in automatico una serie di file indesign in pdf, questo nn funziona +, l'errore segnalato è questo:

InDesign 2.0.2 ha trovato un errore: active document non capisce il messaggio export.

qualcuno sa cosa c'è di sbagliato?
questo è il contenuto dell'actionscript:

--property targetFolder : "Sistema Mac Os --10.4:Usersippopippo:test:"

property extension_list : {"indd"}
property stilePDF : "[pietro-fram]"

--property targetFolder : (choose folder with prompt --"seleziona il folder che conterra' i pdf:") as string
set sourceFolder to (choose folder with prompt "Seleziona il folder contenente i folder dei cataloghi:") as string


processFolder(sourceFolder)

on processFolder(sourceFolder)
tell application "System Events"
set these_folders to every folder of folder sourceFolder
end tell
repeat with i from 1 to the count of these_folders
set theFolder to item i of these_folders
processInDesignItem(theFolder, sourceFolder)
end repeat
display dialog "end"

end processFolder

on processInDesignItem(theFolder, targetFolder)
tell application "System Events"
set these_files to every file of theFolder
end tell

repeat with i from 1 to the count of these_files
set theFile to (item i of these_files as alias)
set this_info to info for theFile

if the file type of the this_info is in the extension_list then

tell application "InDesign 2.0.2"
set myDocument to open theFile
tell active document
set rn to (random number (1000)) as text
set fname to targetFolder & rn & (the name of this_info) & ".pdf"

export format PDF type to fname using stilePDF without showing options
close myDocument saving no
end tell
--close active document saving no
end tell
end if
end repeat
end processInDesignItem