Posts

Post not yet marked as solved
0 Replies
540 Views
I'm trying to run Shortcuts programmatically on Monterey. My understanding is that the official API for this is via AppleScript to the Shortcuts Events process. I created a Shortcut that does Quicklook on the passed in file parameter. It works as a Finder action but I can't figure out how to get it to work when running it via AppleScript or Scripting Bridge. If I send a file, alias or POSIX file, I get a generic Shortcuts error 4. If I send a path as a string, it just does a preview of the string passed in, and not the contents of the file the path references. Anyone have any insight on how to get this working?
Posted
by Mr_Noodle.
Last updated
.
Post not yet marked as solved
5 Replies
471 Views
I'm receiving conflicting info on this. My impression from the docs was that only the DMG would need to be stapled. In a DTS interaction concerning other issues with notarization, the DTS engineer pointed out that my app wasn't stapled and that I should staple that as well. Problem is that when I staple the app, I need to re-create the DMG package. After doing that, when trying to staple the DMG as well it fails with error 65. My guess is that it fails because the signature changed by stapling the app which leads to a bit of a catch-22 situation. Do I really need to staple the app contents and if so, what is the correct procedure for re-packaging and stapling the outer DMG?
Posted
by Mr_Noodle.
Last updated
.
Post not yet marked as solved
0 Replies
210 Views
I've been playing with NSWindowRestoration. I have it set on my app's main window and it seems to be restoring (the methods are called). The problem is that the only thing it's restoring is the window's frame. It was my impression that views would also save/restore state, like NSSplitView and NSOutlineView. I know both of those classes have their own autosave mechanism but I thought those were superceded by NSWindowRestoration. If I need to implement encoding state for standard Appkit classses, it seems like I might as well go back to the old mechanisms and where I set autosavenames. Not seeing much of a point of using NSWindowRestoration. What am I missing here?
Posted
by Mr_Noodle.
Last updated
.
Post not yet marked as solved
2 Replies
363 Views
Some context: https://developer.apple.com/forums/thread/129855 Because, for some reason, my helper app bundle has to have a horrible name of my team ID plus a reverse FQDN, in Notification Center, any notification my helper sends comes from this unwieldy and scary looking process name. I have CFBundleDisplayName set to something more user friendly and oddly, that is what gets used in, say, Activity Monitor, among other places. Is there any way to have my notifications come from a more user friendly process name? I would think it would use CFBundleDisplayName or use the containing app bundle's name, as it does for privacy settings. I feel like if it's not possible then I'll have to add a non-XPC helper process that I'll use just to post user notifications which seems to make my whole effort to follow the security guidelines pointless.
Posted
by Mr_Noodle.
Last updated
.
Post not yet marked as solved
1 Replies
416 Views
I've been noticing that code sign phases seem to take an inordinate amount of time, like on a scale of 3-8 seconds. This adds up when you have multiple binaries involved and are doing incremental builds. Note that this is for debug builds with the --timestamp=none flag set. I've tried turning on verbosity but nothing interesting gets output. Any thoughts on what may be causing this and if there are ways to speed this up? I'm running Xcode 12 beta 5.
Posted
by Mr_Noodle.
Last updated
.
Post marked as solved
4 Replies
605 Views
As per a previous thread which for some reason is not coming up in search, I have an app with a helper app embedded within as a login item. It is registered via SMLoginItemSetEnabled. XPC is used to communicate with it.This was working fine before but recently I'm finding one of the following happening:- The helper app does not launch. launchctl will list an entry for it with an exit code of 78.- The helper app will launch, but when I have Xcode set to attach on launch, it won't attach and any XPC communication doesn't seem to do anything.- The helper app will launch and I can attach with Xcode, but it doesn't seem to stop at any breakpoints. This indicates that some shadow version of the process is running.- I launch the helper app in Xcode but the app will not communicate with it.Also, even when the helper is running and launchctl show things are hunky dory, before, if I killed the process, launchctl would immediately launch it again and I would have to remove it to stop it entirely. Now, it will not relaunch.This has made it near impossible for me to debug anything in the helper for the past couple of days. Any insight or additional tools I can use to diagnose this would be greatly appreciated.Thanks.
Posted
by Mr_Noodle.
Last updated
.
Post not yet marked as solved
0 Replies
288 Views
I have a specific NSToolbarItem subclass. There need to be multiple instances in a toolbar. I overrode -allowsDuplicatesInToolbar though that never gets called. So, to ensure that I get separate instances, I implemented -toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar: to create a new instance every time.The odd thing is that it only gets called for this specific subclass. I can't figure out why it doesn't get called for the other toolbar items. They are all created and loaded from a xib. Now, in this particular case, I only care about this one particular subclass so it works for my current purposes but this seems a bit fragile and I'd like to know the logic here.
Posted
by Mr_Noodle.
Last updated
.
Post marked as solved
4 Replies
632 Views
I've found little documentation about this situation as it mostly is focused on XPC in terms of XPC services. My situation is that I have an app, a helper app and a commandline program. The last two reside with in the first app's bundle.The helper app is not handled by launchd, though may be started as a login item. There are various reasons for this, including the fact that it needs to present UI as well as unique lifecycle/scheduling requirements.I have been using DO to communicate from the app and commmandline program to the helper. I've been told I could use XPC for this and have done the conversion. The helper has a listener on a mach service name. I am using NS API's, btw, not the xpc_* ones.There are some problems though:- It only seems to work if all processes are run or attached from Xcode.- If any of the end points are run outside of Xcode, any connections are immediately invalidated with no other errors or logs presented.Based on other articles which touch on this, I'm still not clear if this is a supported configuration and if it isn't, it would be nice to have a definitive answer. Note that all processes are part of the same app bundle. Also, if it isn't supported, it's a bit confusing that it would work within Xcode.Thanks.
Posted
by Mr_Noodle.
Last updated
.
Post not yet marked as solved
6 Replies
745 Views
Already filed FB6758672It was my impression from the WWDC sessions that the split between the read-only and read-write volumes in Catalina would be, for the most part, hidden. For instance, in Finder, /Applications shows an aggregate of /Applications (on the read-write volume) and /System/Applications (on the read-only volume).It seems that the filesystem APIs (including NSFileManager) do not aggregate these directories. I wanted to double-check here on whether my interpretation of the WWDC session is correct or not. The way it was presented was that you wouldn't notice the difference but just doing "ls /Applications" indicates that we have to be aware and handle these "split" directories.If we are expected to handle this ourselves, then are we just supposed to reverse-engineer which directories are treated like this or is there some API or documentation pointing this out?
Posted
by Mr_Noodle.
Last updated
.