Ajusta el Zoom de Excel 2008 para Mac con Applescript
En más de una ocasión te habrás encontrado que necesitas abrir todos los documentos de Excel a un tamaño prefijado, ya sea porque en el ordenador de sobremesa tienes mas pantalla (y en el portátil todo se ve mucho mas pequeño), o porque necesitas una mejor visión porque la hoja de cálculo es muy grande. Ajustar el nivel de Zoom para todos los documentos (viejos y nuevos) por defecto es un poco complejo tal como viene Office, pero Applescript nos puede ayudar a solventar este problema.
Este Applescript te pregunta a que cantidad de ampliación quieres que se abran los documentos de Excel. Puedes ponerlo en el Dock, y arrastrar los documentos de Excel sobre el cuando quieras abrir un documento en concreto con una ampliación determinada. El rango de ampliación de Excel está entre el 25 y el 400%.
O si quieres, puedes copiarlo y pegarlo en el editor de Scripts para poder modificarlo o traducirlo.
This code was originally written by Mike Cramer on 2008-05-29. Email me at kiodane at [Google's mail service] dot com
*)
property zoomFactor : “”
property prevWinNameList : {}
——————————————–
on open theseFiles
tell application “Microsoft Excel” to open theseFiles
initializeZoomFactor()
end open
——————————————–
on run
initializeZoomFactor()
end run
——————————————–
on idle
–Find out if Excel is still running.
tell application “System Events” to set ExcelIsRunning to (name of processes) contains “Microsoft Excel”
if ExcelIsRunning then
try
tell application “Microsoft Excel”
–Get the currently open windows.
set currWinNameList to name of every window
set currWinList to every window
repeat with anWindow in currWinList –i from 1 to (count of currWinList)
–Compare current windows to the last check
if prevWinNameList contains name of anWindow then
else
tell anWindow to set zoom to zoomFactor
end if
end repeat
–The current windows are next check’s old windows.
set prevWinNameList to currWinNameList
end tell
end try
else
–When Excel quits, the assistant should quit too.
quit
end if
–repeat every 5 seconds.
return 5
end idle
——————————————–
on initializeZoomFactor()
–Make sure Excel is running to begin with.
tell application “Microsoft Excel” to activate
set errMsg to “”
set output to 0
repeat while (output < 25 or output > 400) –The range of Excel’s zoom is 25-400%
activate
display dialog errMsg & “Please enter a Zoom Factor to use with all documents in Excel (25-400):” default answer zoomFactor buttons {”Okay”, “Nevermind”} default button 1
copy the result as list to {text_returned, button_pressed}
if button_pressed = “Okay” then
–Verify the entered text can be converted to a number.
set output to 0
try
set output to text_returned as number
end try
–Check the number is within range
if (output ≥ 25 and output ≤ 400) then
set zoomFactor to output as number
else
set errMsg to “There was an error with your last input.rr”
end if
else
quit
end if
end repeat
–For some reason Excel likes to hide at a previous step sometimes. This line fixes that:
tell application “Microsoft Excel” to activate
end initializeZoomFactor
Publicado por micro en Excel 2008, Trucos el 03-6-2008 | Imprime este artículo | RSS 2.0 | trackback
- Artículo anterior: « Cambiar el número de licencia de tu instalación de Office
- Artículo siguiente: La actualización de QuickTime 7.5 puede causarte algunos problemas en Entourage 2008 »


