Retroactive icon indicating copy to clipboard operation
Retroactive copied to clipboard

Aperture support for AppleEvents for Apple Scripting

Open PawelWitan opened this issue 4 years ago • 1 comments

"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 faking Info.plist

Hope this helps making this great software better

PawelWitan avatar Nov 24 '20 20:11 PawelWitan

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.

gloubibou avatar Jun 03 '21 17:06 gloubibou