Hi again :)
I'm really sorry; just reran and found that the paths were actually different 🙈
I've added this code piece to show the difference:
NSLog(@"Quinn: NSTemporaryDirectory(): %@", NSTemporaryDirectory());
NSError *error = nil;
NSDictionary *dictionary = [NSFileManager.defaultManager attributesOfItemAtPath:NSTemporaryDirectory() error:&error];
NSLog(@"Quinn: error: %@", error);
NSLog(@"Quinn: dictionary: %@", dictionary);
Debug:
2021-06-23 12:35:30.315 QLICProcessor[71421:3730283] Quinn: NSTemporaryDirectory(): /var/folders/_h/cbm2fp054c9byr188mdyxhw00000gp/T/com.apple.quicklook.qlmanage/
2021-06-23 12:35:30.315 QLICProcessor[71421:3730283] Quinn: error: (null)
2021-06-23 12:35:30.316 QLICProcessor[71421:3730283] Quinn: dictionary: {
NSFileCreationDate = "2021-06-18 20:22:23 +0000";
NSFileExtensionHidden = 0;
NSFileGroupOwnerAccountID = 20;
NSFileGroupOwnerAccountName = staff;
NSFileModificationDate = "2021-06-23 10:30:11 +0000";
NSFileOwnerAccountID = 502;
NSFileOwnerAccountName = jsc;
NSFilePosixPermissions = 448;
NSFileProtectionKey = NSFileProtectionCompleteUntilFirstUserAuthentication;
NSFileReferenceCount = 16;
NSFileSize = 512;
NSFileSystemFileNumber = 32688057;
NSFileSystemNumber = 16777220;
NSFileType = NSFileTypeDirectory;
}
and archive:
2021-06-23 12:28:13.608 QLICProcessor[62356:3702628] Quinn: NSTemporaryDirectory(): /var/folders/_h/cbm2fp054c9byr188mdyxhw00000gp/T/
2021-06-23 12:28:13.608 QLICProcessor[62356:3702628] Quinn: error: (null)
2021-06-23 12:28:13.609 QLICProcessor[62356:3702628] Quinn: dictionary: {
NSFileCreationDate = "2021-05-17 13:09:39 +0000";
NSFileExtendedAttributes = {
"com.apple.rootless" = {length = 7, bytes = 0x666f6c64657273};
};
NSFileExtensionHidden = 0;
NSFileGroupOwnerAccountID = 20;
NSFileGroupOwnerAccountName = staff;
NSFileModificationDate = "2021-06-23 10:20:49 +0000";
NSFileOwnerAccountID = 502;
NSFileOwnerAccountName = jsc;
NSFilePosixPermissions = 448;
NSFileProtectionKey = NSFileProtectionCompleteUntilFirstUserAuthentication;
NSFileReferenceCount = 1958;
NSFileSize = 62656;
NSFileSystemFileNumber = 529943;
NSFileSystemNumber = 16777220;
NSFileType = NSFileTypeDirectory;
}
The command I use to start the app: qlmanage -p -c com.mycompany.myfile -g MyQLGenerator.qlgenerator ~/Desktop/MyFile.xyz
Update: If I enabled the Hardened Runtime exception 'Allow DYLD Environment Variables' I also get the working path /var/folders/_h/cbm2fp054c9byr188mdyxhw00000gp/T/com.apple.quicklook.qlmanage/
...
Thanks! :)