cormiertyshawn895 / Retroactive

Retroactive has been discontinued. You should transition from Retroactive to supported apps such as Music, iTunes for Windows, iMazing, Photos, Darktable, Lightroom Classic, and DaVinci Resolve.
2.17k stars 115 forks source link

Aperture support for AppleEvents for Apple Scripting #160

Closed PawelWitan closed 1 month ago

PawelWitan commented 3 years ago

"tell Aperture" in Apple Scripts was not working with Aperture after making it work via Retroactive in Catalina.

I was able to circumvent that with code singing using additional plist file made with: /usr/libexec/PlistBuddy -c "Add :com.apple.security.automation.apple-events bool true" Entitlements.plist Then the code signing was performed with that file:  sudo codesign -fs - --entitlements Entitlements.plist /Applications/Aperture.app --deep  And now it is working

Don't know if it was a problem in my setup, but after Retroactive, Aperture was working properly, but was not signed:

 codesign -d --entitlements :- /Applications/Aperture.app
 /Applications/Aperture.app: code object is not signed at all

Also I had to deal with two problems with codesign:

/Applications/Aperture.app: resource fork, Finder information, or similar detritus not allowed
 In subcomponent: /Applications/Aperture.app/Contents/Frameworks/iLifeAssetManagement.framework

With sudo xattr -rc /Applications/Aperture.app/Contents/Frameworks/iLifeAssetManagement.framework/ And

/Applications/Aperture.app: bundle format unrecognized, invalid, or unsuitable
 In subcomponent: /Applications/Aperture.app/Contents/Frameworks/AppKit.framework

with restructuring the framework directory and fakingInfo.plist

Hope this helps making this great software better

gloubibou commented 3 years ago

Working from Pawel's report I came up with the following series of commands that allowed me to code-sign Aperture on Big Sur. Once that was done, I was able to authorize HoudahGeo to automate Aperture.

cd /Applications/Aperture.app/Contents/Frameworks/AppKit.framework
sudo mkdir Versions/C/Resources/
cd Versions/
sudo ln -s C Current
cd ..
sudo ln -s Versions/Current/Resources Resources
sudo ln -s Versions/Current/AppKit AppKit

sudo /usr/libexec/PlistBuddy -c "Add :CFBundleExecutable string" /Applications/Aperture.app/Contents/Frameworks/AppKit.framework/Versions/C/Resources/Info.plist
sudo /usr/libexec/PlistBuddy -c "Set :CFBundleExecutable AppKit" /Applications/Aperture.app/Contents/Frameworks/AppKit.framework/Versions/C/Resources/Info.plist

codesign -vvv -fs - /Applications/Aperture.app

I did not have a problem with iLifeAssetManagement.framework. I thus omitted the step of cleaning the extended attributes.

cormiertyshawn895 commented 1 month ago

Retroactive has been discontinued, and does not support macOS Sequoia or later. You should transition from Retroactive to a wide range of supported apps, many of which are built into macOS or free to download. Learn how to transition from Retroactive to supported apps.