Hello
A user which just switched from Snow Leopard to Mavericks asked me about an odd behavior.
He said that for years he used this piece of code :
set p2Documents to path to documents folder as text
tell application "Safari" activate save front document in file (p2Documents & "xx.html") end tell
Alas, when he try to use it under Mavericks (behave the same under 10.8.5), he get : (* Le document « Getting a value from one Filemaker DB and see if it exists in another. » n’a pas pu être exporté sous le nom « xx.html ».
error "Erreur dans Safari : Le gestionnaire AppleEvent a échoué." number -10000 *)
I made different attempts with no success — same behavior in Smile but correct one under Script Debugger — so I guess that there is an heavy smell of bug.
At this time my workaround is GUI Scripting :
activate application "Safari" tell application "System Events" to tell (first process whose frontmost is true) keystroke "s" using {command down} delay 0.1 keystroke "d" using {command down} # pour enregistrer sur le bureau keystroke return end tell
but the asker is reluctant to use it.
Am I missing something ?
Yvan KOENIG (VALLAURIS, France) jeudi 26 décembre 2013 11:41:48
|