AppleScript ed AppleWorks

 
Nuovo argomento    Rispondi    Faqintosh :: Forum :: Per utenti smaliziati - La fucina delle FAQ
Precedente   Successivo  
Autore Messaggio
borgo1971


Registrato: 14/04/09 08:53
Messaggi: 18
Residenza: Tolmezzo (UD)
Novello

R13 Messaggio Inviato: Ven 14 Mag 2010, 16:32    Oggetto: AppleScript ed AppleWorks Rispondi citando

Ho fatto un Applescript per convertire tutti i documenti AppleWorks che abbiamo ancora in giro per il server. Dopo varie peripezie sono quasi riuscito a farlo funzionare (senza esportare i traduttori non ne voleva sapere), perņ ancora non riseco a fargli scrivere il file con l'estensione corretta invece di sovrascrivere il file originale (utilizzando comunque il traduttore).
Qualcuno mi aiuta? Almeno ad appendere l'estensione giusta (io vorrei far togliere il .cwk, mettere .xls o .doc se c'č e scrivere il file accanto all'originale). Questo č lo script:

set file_convertiti to {}
tell application "Finder"
set percorso_ricerca to choose folder
set elenco_cwk to (every file in entire contents of percorso_ricerca whose ((name extension is "cwk") or ((creator type is "BOBO") and (name extension is not "rtf"))))
end tell
set num_file to number of items in elenco_cwk
repeat with num_cwk from 1 to number of items in elenco_cwk
set current_cwk to item num_cwk of elenco_cwk
tell application "AppleWorks 6"
set traduttori to export translators
open current_cwk
set documento_aperto to the name of document 1
set tipo_documento to the document kind of document 1
if tipo_documento is text document then
set nome_cwk_convertito to documento_aperto & ".doc"
save document 1 in nome_cwk_convertito as file type "W8BN" using translator "Word Mac 98, 2001 document"
end if
if tipo_documento is spreadsheet document then
set nome_cwk_convertito to documento_aperto & ".xls"
save document 1 in nome_cwk_convertito as file type "XLS8" using translator "Excel Mac 98, 2001 spreadsheet"
end if
close document 1 without saving
end tell
copy nome_cwk_convertito to the end of file_convertiti
end repeat

get file_convertiti
Top
Profilo Invia messaggio privato AIM
Mostra prima i messaggi di:   
Nuovo argomento   Rispondi    Faqintosh :: Forum :: Per utenti smaliziati - La fucina delle FAQ Tutti i fusi orari sono GMT + 1 ora
Pagina 1 di 1

 
Vai a:  
Non puoi inserire nuovi argomenti
Non puoi rispondere a nessun argomento
Non puoi modificare i tuoi messaggi
Non puoi cancellare i tuoi messaggi
Non puoi votare nei sondaggi

Cerca il Forum con Google