IPB     Il futuro di Tevac dipende da te!  

Benvenuto Visitatore ( Log In | Registrati )

  · · · · · · · · · · · ·
Reply to this topicStart new topic
> [AppleScript] Export InDesign
sabi
messaggio 23 Oct 2007, 14:57
Messaggio #1


Level 1/11
*

Gruppo: Members
Messaggi: 6
Iscritto il: 23-October 07
Utente Nr.: 8.918



Ciao a tutti,
ho un problemino, avevo un actionscript che mi trasformava in automatico una serie di file indesign in pdf, questo nn funziona più, 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:

CODE
--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


Messaggio modificato da poweruser il 25 Oct 2007, 00:52
Motivo della modifica: Modificato il titolo
Go to the top of the page
 
+Quote Post
chebfarid
messaggio 23 Oct 2007, 20:41
Messaggio #2


Level 8/11
********

Gruppo: Team Moderatori
Messaggi: 3.785
Iscritto il: 11-July 03
Da: Milano
Utente Nr.: 395



Ciao,
purtroppo non ho InDesign e quindi non posso sperimentare il tuo script.
Se scrivi che prima funzionava e ora non più: che cos'hai cambiato nel frattempo?
Hai modificato lo script stesso ?
Hai fatto un upgrade a una versione nuova di InDesign (a volte cambia la terminologia AppleScript fra una versione e l'altra) ?
Forse basta sostituire la riga
CITAZIONE
tell active document
con
CODICE
tell document 1


Saluti
Farid


--------------------
Abends lustig, morgens triste
das ist Leben von Artiste
Go to the top of the page
 
+Quote Post
sabi
messaggio 24 Oct 2007, 17:09
Messaggio #3


Level 1/11
*

Gruppo: Members
Messaggi: 6
Iscritto il: 23-October 07
Utente Nr.: 8.918



Ciao,
Grazie intanto,
ho provato come mi hai detto tu, ma l'errore è sempre lo stesso, per quanto riguarda la versione di indesign è sempre la stessa,
infatti la cosa è stranissima.
Sono disperata!!! icon_eek.gif
HELP!!!
Go to the top of the page
 
+Quote Post
Luca Dentis
messaggio 24 Oct 2007, 18:15
Messaggio #4


S.A.Y.K.
******

Gruppo: Supporter
Messaggi: 1.467
Iscritto il: 22-August 07
Da: /008/055
Utente Nr.: 8.622



hai provato ad incapsulare il tuo script nel costrutto "using terms from application...end using terms from"?
Lo script modificato dovrebbe avere questa struttura
CODICE
using terms from application "InDesign 2.0.2"
--qui va il codice che hai scritto tu
end using terms from


--------------------
Share All Your Knowledge

A guy's dream
Go to the top of the page
 
+Quote Post
sabi
messaggio 24 Oct 2007, 18:49
Messaggio #5


Level 1/11
*

Gruppo: Members
Messaggi: 6
Iscritto il: 23-October 07
Utente Nr.: 8.918



CITAZIONE(Luca Dentis @ 24 Oct 2007, 18:15) *
hai provato ad incapsulare il tuo script nel costrutto "using terms from application...end using terms from"?
Lo script modificato dovrebbe avere questa struttura
CODICE
using terms from application "InDesign 2.0.2"
--qui va il codice che hai scritto tu
end using terms from

ho "incapsulato" come hai detto tu, ma l'errore è sempre lo stesso.
Go to the top of the page
 
+Quote Post
chebfarid
messaggio 24 Oct 2007, 19:02
Messaggio #6


Level 8/11
********

Gruppo: Team Moderatori
Messaggi: 3.785
Iscritto il: 11-July 03
Da: Milano
Utente Nr.: 395



Forse sostituendo così: ?
CITAZIONE
tell active document
con
CODICE
tell myDocument


Ciao
Farid


--------------------
Abends lustig, morgens triste
das ist Leben von Artiste
Go to the top of the page
 
+Quote Post
sabi
messaggio 24 Oct 2007, 19:42
Messaggio #7


Level 1/11
*

Gruppo: Members
Messaggi: 6
Iscritto il: 23-October 07
Utente Nr.: 8.918



CITAZIONE(chebfarid @ 24 Oct 2007, 19:02) *
Forse sostituendo così: ?
CITAZIONE
tell active document
con
CODICE
tell myDocument


Ciao
Farid

già provato!!!
grazie
Sabi
Go to the top of the page
 
+Quote Post
Fed3rico
messaggio 24 Oct 2007, 19:48
Messaggio #8


FED3RICO
******

Gruppo: Supporter
Messaggi: 1.830
Iscritto il: 3-July 04
Da: Tamara
Utente Nr.: 2.082



- Prova a applicare il comando export direttamente ad un documento aperto manualmente in InDesign. Così il codice è più semplice, tipo:

CODE
tell app "InDesign"
    tell active document
        export format PDF type to (choose file name) using "[pietro-fram]" without showing options
    end tell
end tell


Così capisci se il problema è nell'uso di quel comando o in qualcosa che viene prima. Tra parentesi vedo negli esempi della Scripting Guide di Adobe che i nomi dei preset non usano le quadre, magari centra qualcosa? Magari prova con un altro preset.

- Prova anche ad aggiungere active document come parametro diretto di export:

CODE
export active document format PDF type ...


- L'evento "open" mi pare sia asincrono (secondo questo dizionario non dovrebbe nemmeno restituire niente), facile che al momento in cui il tuo script esegue il comando "export" la proprietà "active document" sia vuota, prova ad aggiungere un delay di qualche secondo (es.: "delay 2") dopo "open".


--------------------
iPhone è un troll.
Go to the top of the page
 
+Quote Post
sabi
messaggio 24 Oct 2007, 21:10
Messaggio #9


Level 1/11
*

Gruppo: Members
Messaggi: 6
Iscritto il: 23-October 07
Utente Nr.: 8.918



CITAZIONE(Fed3rico @ 24 Oct 2007, 19:48) *
- Prova a applicare il comando export direttamente ad un documento aperto manualmente in InDesign. Così il codice è più semplice, tipo:

CODICE
tell app "InDesign"
    tell active document
        export format PDF type to (choose file name) using "[pietro-fram]" without showing options
    end tell
end tell


Così capisci se il problema è nell'uso di quel comando o in qualcosa che viene prima. Tra parentesi vedo negli esempi della Scripting Guide di Adobe che i nomi dei preset non usano le quadre, magari centra qualcosa? Magari prova con un altro preset.

- Prova anche ad aggiungere active document come parametro diretto di export:

CODICE
export active document format PDF type ...


- L'evento "open" mi pare sia asincrono (secondo questo dizionario non dovrebbe nemmeno restituire niente), facile che al momento in cui il tuo script esegue il comando "export" la proprietà "active document" sia vuota, prova ad aggiungere un delay di qualche secondo (es.: "delay 2") dopo "open".

Ciao,
scusa ma non sono un'esperta in programmazione,
e praticamente non ho capito quasi nulla di quello che mi hai scritto,
potresti spiegarmi in parole più semplici?!?!?
se riesci a farmi funzionare questo script ti invito a cena!! icon_redface.gif icon_biggrin.gif
Go to the top of the page
 
+Quote Post
Fed3rico
messaggio 25 Oct 2007, 11:01
Messaggio #10


FED3RICO
******

Gruppo: Supporter
Messaggi: 1.830
Iscritto il: 3-July 04
Da: Tamara
Utente Nr.: 2.082



Quelli che ho postato sono tentativi per cercare di identificare il problema, nemmeno io ho InDesign quindi non posso provare lo script direttamente; il messaggio d'errore non è molto d'aiuto, e a cercarlo con google i primi risultati sono i tuoi post :°D

- Verificare che l'esportazione manuale in PDF dello stesso documento funzioni correttamente;

- Verificare che il nome del preset ("[pietro-fram]") sia corretto, e magari provarne un altro;

- Provare se una versione ridotta dello stesso script funziona su un documento già aperto:

CODE
tell app "InDesign"
    tell active document
        export format PDF type to (choose file name) using "[pietro-fram]" without showing options
    end tell
end tell


- Provare se una versione ridotta dello stesso script funziona anche su documenti aperti via script:

CODE
tell app "InDesign"
    open (choose file)
    tell active document
        export format PDF type to (choose file name) using "[pietro-fram]" without showing options
    end tell
end tell


- Aggiungere una pausa di tot secondi (delay 5 -> sospende l'esecuzione per 5 secondi) dopo l'apertura del documento:

CODE
set myDocument to open theFile
delay 5
tell active document


- Sostituire tutto il blocco "tell active document" con:

CODE
set rn to (random number (1000)) as text
set fname to targetFolder & rn & (the name of this_info) & ".pdf"

export active document format PDF type to fname using stilePDF without showing options





--------------------
iPhone è un troll.
Go to the top of the page
 
+Quote Post
sabi
messaggio 25 Oct 2007, 14:13
Messaggio #11


Level 1/11
*

Gruppo: Members
Messaggi: 6
Iscritto il: 23-October 07
Utente Nr.: 8.918



CITAZIONE(Fed3rico @ 25 Oct 2007, 11:01) *
Quelli che ho postato sono tentativi per cercare di identificare il problema, nemmeno io ho InDesign quindi non posso provare lo script direttamente; il messaggio d'errore non è molto d'aiuto, e a cercarlo con google i primi risultati sono i tuoi post :°D

- Verificare che l'esportazione manuale in PDF dello stesso documento funzioni correttamente;

- Verificare che il nome del preset ("[pietro-fram]") sia corretto, e magari provarne un altro;

- Provare se una versione ridotta dello stesso script funziona su un documento già aperto:

CODICE
tell app "InDesign"
    tell active document
        export format PDF type to (choose file name) using "[pietro-fram]" without showing options
    end tell
end tell


- Provare se una versione ridotta dello stesso script funziona anche su documenti aperti via script:

CODICE
tell app "InDesign"
    open (choose file)
    tell active document
        export format PDF type to (choose file name) using "[pietro-fram]" without showing options
    end tell
end tell


- Aggiungere una pausa di tot secondi (delay 5 -> sospende l'esecuzione per 5 secondi) dopo l'apertura del documento:

CODICE
set myDocument to open theFile
delay 5
tell active document


- Sostituire tutto il blocco "tell active document" con:

CODICE
set rn to (random number (1000)) as text
set fname to targetFolder & rn & (the name of this_info) & ".pdf"

export active document format PDF type to fname using stilePDF without showing options



Ciao,
ho fatto le prove che mi hai detto,
e nel ridurre lo script il messaggio di errore è:
indesign 2.02 ha trovato un errore: non posso trasformare PDF type nel tipo <<class kfil>>
e anche le altre prove non sono andate a buon fine!! icon_eek.gif
Go to the top of the page
 
+Quote Post
Fed3rico
messaggio 25 Oct 2007, 15:26
Messaggio #12


FED3RICO
******

Gruppo: Supporter
Messaggi: 1.830
Iscritto il: 3-July 04
Da: Tamara
Utente Nr.: 2.082



Boh :°D

Più o meno in tutti gli esempi che ho trovato la forma del comando export è la stessa (dentro a tell active document), l'unica differenza è che a volte cambia il parametro "using":

tell active document
    export format PDF type to (choose file name) using PDF export preset "[pietro-fram]" without showing options
end tell


--------------------
iPhone è un troll.
Go to the top of the page
 
+Quote Post
chebfarid
messaggio 25 Oct 2007, 15:42
Messaggio #13


Level 8/11
********

Gruppo: Team Moderatori
Messaggi: 3.785
Iscritto il: 11-July 03
Da: Milano
Utente Nr.: 395



Un documento sul sito della Adobe How To: Export PDFs with named Styles/Presets using AppleScript è consultabile qui.

Hope it helps
Farid


--------------------
Abends lustig, morgens triste
das ist Leben von Artiste
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

 

Collapse

> 

    Titolo discussione Risposte Autore discussione Visite Ultima azione
No New Posts   0 ilgio 67 29 October 2008 - 20:29
Ultimo messaggio di: ilgio
No New Posts   2 taddeima 87 27 October 2008 - 09:36
Ultimo messaggio di: taddeima
No New Posts 1 arcus 73 26 October 2008 - 14:28
Ultimo messaggio di: Simply Mac
No New Posts 2 otto.pic 113 30 July 2008 - 14:02
Ultimo messaggio di: otto.pic
No New Posts   3 joz 153 25 July 2008 - 10:05
Ultimo messaggio di: joz
No New Posts   0 Federico_82 138 21 July 2008 - 18:39
Ultimo messaggio di: Federico_82
No New Posts   2 arbushell 156 14 July 2008 - 23:36
Ultimo messaggio di: arbushell
No New Posts   4 areyoulucio 411 23 June 2008 - 01:53
Ultimo messaggio di: Biba
No new   10 [Daitarn] 1.862 28 May 2008 - 12:20
Ultimo messaggio di: [Daitarn]
No New Posts   4 fede86 168 27 May 2008 - 08:27
Ultimo messaggio di: fede86
No new   10 fede86 178 26 May 2008 - 19:01
Ultimo messaggio di: Baco
No New Posts   4 ennesimanamnesi 180 26 May 2008 - 08:41
Ultimo messaggio di: kato

Modalità di visualizzazione: Normale · Passa a: Lineare · Passa a: Outline


RSS Versione Lo-Fi Oggi è il: 2 December 2008 - 17:37
IP.Board Skin Developed By Creative Networks