(1) We are warned for years that info for is deprecated.
I wrote many scripts many years ago that I have used since, with occasional updates. I’m not a professional developer and was not aware of this.
(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.
ditto
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 ?
It’s an app onto which you drag a file or folder. The script checks to see if it’s in an acceptable location, eg on the user’s desktop, but not the root folder, or any system folders, etc. It then calls a shell script to make permissions on that folder wide open and delete ACL’s. We call it before dragging media files to a Mac OS X server, and we have always found that it tends to eliminate permissions problems for other users accessing those files from the server. This is because OS X Server does not, (AFAIK), properly respect POSIX permissions. This may have changed, but our servers are still running 10.6.8.
The script was running fine on my computer, but when I copied it to another user the access violations showed up. I repaired his permissions and that seems to have fixed it. But I also added a “tell me” block to those lines and the “do shell script” lines, just to be safe.
My other issue is that Script Editor very often says it cannot save an app, or even do a Save As. Then I have to copy the text, make a new script, paste it in, and save it fresh. Some have suggested that it’s a permissions issue, but I don’t think so. I think that Script Editor is having trouble saving backups into it’s container, and this is iCloud related, even though I have iCloud drive turned off.
Thanks.
Jim Weisbin | C.T.O. | human | 138 Fifth Avenue | 3rd Floor | New York, NY | 10011 | (212) 352-0211 | (917) 375-2272 | Los Angeles Office | 2046 Broadway | Santa Monica, CA | 90404 | (310) 264-0211 telephone | www.humanworldwide.com Click here to view our online reel