Well I need a simple script that launch Image Transfert (with scanner UI) and force some presets to ensure that proper action will be performed.
In ideal world I’d like to perform a kind of select all on the scan preview. See later for that.
Current issue: setting the default action after the scan to Mail.app… Not so easy.
Here is my script in its current state:
-- English name? Image Transfert
set nomAppli to "Image Capture"
-- Your scanner
set nomSource to "EPSON Perfection 2480/2580"
set MailApp to (path to application "Mail" as alias)
tell application nomAppli
activate
tell application "System Events"
if UI elements enabled then
tell process nomAppli
click menu item nomSource of menu of menu bar item "Appareils" of menu bar 1
tell window 1
-- Résolution à 150ppp
set value of combo box 1 to "150"
-- Format JPEG pour la numérisation
tell pop up button 7
click
tell menu 1
click menu item "JPEG"
end tell
end tell
-- Tâche automatique à Aperçu
tell pop up button 9
click
-- wanna set this to MailApp value.
tell menu 1
-- This shall be other... in english ?
-- This fails as error... Why?
click menu item "autre..."
end tell
end tell
--
end tell -- window 1
end tell
else
tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.universalaccess"
display dialog "Les scripts pour éléments d'interface graphique ne sont pas activés. Cochez \"Activer l'accès pour les périphériques d'aide.\""
end tell
end if
end tell
end tell
Seems that last pop up do not share the same behavior as other…
Any idea on how I could set a value on this one?
Thanks,
Model: MacBook Pro
AppleScript: 2.0.1
Browser: Safari 528.16
Operating System: Mac OS X (10.5)