This line breaks with an access violation in OS X 10.10.3:
set myInfo to info for f without size
The solution seems to be to wrap it in a "tell me" block, which I found here:
For security reasons, most scripting addition commands now return a “privilege violation” error when sent between application processes. In order to preserve compatibility with existing scripts, AppleScript redirects most of these commands to the current application, that is, the process running the script. If a script sends events to a remote computer via EPPC (“Remote Apple Events”), AppleScript may redirect them to the System Events process on the target machine. AppleScript Editor’s Event Log will show when this redirection happens: you will see the event sent first to the original target process, return an error, and then sent again, often to the current application.
So, problem solved for now, but I have no idea why "info for..." is considered to be another application process, or how this might affect my other many long time working scripts.
(1) We are warned for years that info for is deprecated.
(2) We are warned for 3 or 4 years that call to OSAX functions are not allowed to be in tell application blocks. info for is a component of the OSAX named Standard Additions so I was not surprised to read what you got.
As I am curious, I tested the command in a tell application "Finder" block upon a file stored on the desktop and I was surprised : I got no error Same behavior with a file located in the System Folder.
The code used is :
set f to (path to desktop folder as text) & "sur Gerbino.pdf" as alias
tell application "Finder" set myInfo to info for f without size end tell
What is the application triggered by the block embedding the offending call ? What is the file location ?
Yvan KOENIG (VALLAURIS, France) jeudi 30 avril 2015 18:21:27
|