Re: recycleURLs doesn't enable Put Back or Undo in Finder
Re: recycleURLs doesn't enable Put Back or Undo in Finder
- Subject: Re: recycleURLs doesn't enable Put Back or Undo in Finder
- From: Steve Mills <email@hidden>
- Date: Tue, 20 Jan 2015 11:00:34 -0600
On Jan 20, 2015, at 08:14:56, Jerry Krinock <email@hidden> wrote:
>
>
> To clarify Steve’s question: Is there any way to compile the following as an NSAppleScript and execute it from a *sandboxed* app?
>
> with timeout 15 seconds
> tell application "Finder"
> delete POSIX file “/path/to/whatever"
> end tell
> end timeout
Thanks Jerry. The docs are pretty unclear on where to find information, so I'm left with just guessing and trying stuff. So, I changed all the built-in entitlements to read-write. Didn't help. I added both delete and move as actions that Finder is allowed to do. Not sure if either is correct, but they match known AppleScript terms. Didn't help. Somewhere it said to look at an app's sdef with the sdef command line tool. I did that for Finder, but it spits it out in one big chunk with no formatting, so it's hard to parse. But searching for "trash" showed it was the "delete" command (which I already knew). Here's what my .entitlements looks like at this point:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.assets.movies.read-write</key>
<true/>
<key>com.apple.security.assets.music.read-write</key>
<true/>
<key>com.apple.security.assets.pictures.read-write</key>
<true/>
<key>com.apple.security.files.bookmarks.app-scope</key>
<true/>
<key>com.apple.security.files.downloads.read-write</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.scripting-targets</key>
<dict>
<key>com.apple.finder</key>
<array>
<string>com.apple.finder.delete</string>
<string>com.apple.finder.move</string>
</array>
</dict>
</dict>
</plist>
Do I need to startAccessingSecurityScopedResource on both the file's parent folder and the Trash folder? That seems excessive. Plus, I just have normal urls to the files I'm trashing, not security-scoped urls gleaned from a bookmark.
--
Steve Mills
Drummer, Mac geek
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden