Post

Replies

Boosts

Views

Activity

[Applescript] set miniatured property failed
Hi, Recently we tested how to minimize app using Applescript as below picture and find some interesting phenomenon. After executing the script, if “miniaturized” marked in green (recognized as parameter), it failed to set minimize property. If “miniaturized” marked in purple, it is ok to set minimize property. Because the syntax is exactly the same, could you help to guide us what is wrong with the script? Sincerely, Thanks, YM
3
0
782
May ’23
"URLsForApplicationsToOpenContentType" alternative in macOS
Recently we surveyed macOS file association by extension to retrieve what app to “open with”. Ex: image.png -> “Preview” to open “URLsForApplicationsToOpenContentType”(macOS 12.0+) is a good API which returns NSArray for “open with” app list. https://developer.apple.com/documentation/appkit/nsworkspace/3752999-urlsforapplicationstoopencontent May I ask the alternative for “URLsForApplicationsToOpenContentType” below macOS 12.x ?  “LSCopyDefaultApplicationURLForContentType” (macOS 10.10–12.00) is “Deprecated”. https://developer.apple.com/documentation/coreservices/launch_services?language=objc
0
0
285
Nov ’22
NSAppleScript memory leak
Platform: macOS 12.3.1 Xcode: 13.3 I had Xcode ARC turned ON. AppleScript should be declared like below. NSAppleScript *script = [[NSAppleScript alloc] initWithSource:strScript]; When call AppleScript, open "Monitor.app" app will observe some memory leak. I try to wrap AppleScript by autoReleasePool. Memery leak still exists @autoreleasepool { NSAppleScript *script = [[NSAppleScript alloc] initWithSource:strScript]; //script to do something } Is there other suggestion to do gabage collection to release memory?
15
0
2.5k
Apr ’22
Detect Accessibility privilege using ObjectiveC++ in Xcode
Hi, Detecting "Accessibility" granted or not will work using "AXIsProcessTrustedWithOptions" API in Xcode with compile source as "According to file type". But changing Xcode setting with compile source as "Objective C++" will make "AXIsProcessTrustedWithOptions" API always return "NO" since the Accessibility privilege is granted in "Security & privacy". Does anyone have any idea about this? Thanks, YM
0
0
417
May ’21