• Blog
  • Categories
    • App Store
    • Benchmarks
    • iOS
    • Objective-C
    • OS X
    • PHP
    • RV
    • Swift
    • tvOS
    • Web
  • Apps
    • Portfolio
    • Studio Pro
    • Sun & Moon
  • Photography

Projects

Remote Working, iOS, Mac OS X, and more

App Store

Things Not Allowed in the Mac App Store: Interacting with Finder via AppleScript

A recent client project (an OS X app) had some functionality that included acquiring the path to the frontmost Finder window. The only way to get that path is via AppleScript:

tell application "Finder"
    set frontpath to POSIX path of (target of window 1 as alias)
end tell

Using AppleScript in a sandboxed app requires an entitlement. The official one is “com.apple.security.scripting-targets”, but, unfortunately, some system-level applications have not been enhanced to support that entitlement (e.g., Mail has whereas Finder has not). This means that a temporary entitlement must be used instead: “com.apple.security.temporary-exception.apple-events”.

Here’s what happens when you use that:

App Store rejection message

Radar 24841953 filed for an enhancement to Finder to allow interaction within a sandboxed, Mac App Store app.

Previous
Next

Copyright 2025 Ryan Britton