Feb 23

He escrito un pequeño AppleScript para ilustrar la capacidad de interacción

que posee el lenguaje de scripts de OS X con el paquete ofimático de Apple

llamado iWork que copia todas las tablas y datos de un documento de Numbers

en un documento de KeyNote.

Cada hoja se transforma en una escena de una presentación de KeyNote.

He aquí el código :

tell application “Keynote”

activate
make new slideshow — crea una presentación
set newSlideShow to slideshow 1 — mantiene una referencia
end tell

tell application “Numbers”
activate
tell document 1
set NumeroDeHojas to the count of sheets
end tell
end tell

– display dialog NumeroDeHojas

repeat with i from 1 to NumeroDeHojas

tell application “Numbers”
activate
tell table 1 of sheet i of document 1 to activate

tell application “System Events” to keystroke “a” using {command down}

tell application “System Events” to keystroke “c” using {command down}
end tell

tell application “Keynote”
activate
set newSlide to make new slide at the end of newSlideShow
tell newSlide
tell application “System Events” to keystroke “v” using {command down}
end tell
end tell
end repeat

Que la fuerza de los Scripts os acompañe….


Post to Twitter Publica en Twitter

written by MinYunMen \\ tags: , , , , ,