Post

Replies

Boosts

Views

Activity

Reply to Bug: Finder/AppleScript interaction
Thank you so much for checking. The bug was 100% reproducible - even verified today. I recompiled the ScriptApp from source and that seems to have fixed it (AFAICT). Maybe it was an artifact of porting it from Intel to AS? (Though the buggy version seems to have a fresh-ish date.) BTW- "dump files" just meant standard Finder drag and drop from the same parent folder. Anyway, your feedback gave the impetus to dig a little deeper. Thanks again.
3w
Reply to valid replacement for kUTTypeJPEG which is deprecated
In the example below for Swift users, "UTType.mpeg4Movie" replaces "kUTTypeMPEG4" The dev group did a nice job cleaning up the syntax. The dev docs group dropped the ball by noting that that "typeIdentifierKey" is deprecated, but not mentioning that "contentTypeKey" is the intended replacement - https://developer.apple.com/documentation/foundation/urlresourcekey/1416354-typeidentifierkey. The "contentTypeKey" could refer to anything; "contentTypeIdentifierKey" or "contentUTIdentiferKey" would have made it several hours easier to figure out. Note: the example extension of URL maybe applies solely to macOS and/or file URLs. Advance apologies for typos. Sample usage for casual hobbyists like me: let myFileURL = URL( ... appropriate initialization here ...) // unwrap as needed if myFileURL.isMPEG4{ //do stuff } Extension: extension URL { // new style var contentType: UTType? { return (try? resourceValues(forKeys: [.contentTypeKey]))?.contentType } var isMPEG4:Bool { guard let contentType = contentType else {return false} // search for contentType failed return contentType.conforms(to: UTType.mpeg4Movie) ? true : false } // this is deprecated (macOS > 12?) // based on: https://stackoverflow.com/questions/28570627/how-to-find-file-uti-for-file-withouth-pathextension-in-a-path-in-swift var typeIdentifier: String? { return (try? resourceValues(forKeys: [.typeIdentifierKey]))?.typeIdentifier // will need to convert output to CFString to test against UTTypeConformsTo } var DeprecatedIsMPEG4:Bool { guard let typeIdentifier = typeIdentifier else {return false} // test against the specific type if UTTypeConformsTo(typeIdentifier as CFString, kUTTypeMPEG4) {return true} return false } }
Topic: Media Technologies SubTopic: Audio Tags:
May ’23
Reply to Bug: Finder/AppleScript interaction
Thank you so much for checking. The bug was 100% reproducible - even verified today. I recompiled the ScriptApp from source and that seems to have fixed it (AFAICT). Maybe it was an artifact of porting it from Intel to AS? (Though the buggy version seems to have a fresh-ish date.) BTW- "dump files" just meant standard Finder drag and drop from the same parent folder. Anyway, your feedback gave the impetus to dig a little deeper. Thanks again.
Replies
Boosts
Views
Activity
3w
Reply to Bug: Finder/AppleScript interaction
{Comment deleted)
Replies
Boosts
Views
Activity
3w
Reply to valid replacement for kUTTypeJPEG which is deprecated
In the example below for Swift users, "UTType.mpeg4Movie" replaces "kUTTypeMPEG4" The dev group did a nice job cleaning up the syntax. The dev docs group dropped the ball by noting that that "typeIdentifierKey" is deprecated, but not mentioning that "contentTypeKey" is the intended replacement - https://developer.apple.com/documentation/foundation/urlresourcekey/1416354-typeidentifierkey. The "contentTypeKey" could refer to anything; "contentTypeIdentifierKey" or "contentUTIdentiferKey" would have made it several hours easier to figure out. Note: the example extension of URL maybe applies solely to macOS and/or file URLs. Advance apologies for typos. Sample usage for casual hobbyists like me: let myFileURL = URL( ... appropriate initialization here ...) // unwrap as needed if myFileURL.isMPEG4{ //do stuff } Extension: extension URL { // new style var contentType: UTType? { return (try? resourceValues(forKeys: [.contentTypeKey]))?.contentType } var isMPEG4:Bool { guard let contentType = contentType else {return false} // search for contentType failed return contentType.conforms(to: UTType.mpeg4Movie) ? true : false } // this is deprecated (macOS > 12?) // based on: https://stackoverflow.com/questions/28570627/how-to-find-file-uti-for-file-withouth-pathextension-in-a-path-in-swift var typeIdentifier: String? { return (try? resourceValues(forKeys: [.typeIdentifierKey]))?.typeIdentifier // will need to convert output to CFString to test against UTTypeConformsTo } var DeprecatedIsMPEG4:Bool { guard let typeIdentifier = typeIdentifier else {return false} // test against the specific type if UTTypeConformsTo(typeIdentifier as CFString, kUTTypeMPEG4) {return true} return false } }
Topic: Media Technologies SubTopic: Audio Tags:
Replies
Boosts
Views
Activity
May ’23
Reply to Developer Documentation within Xcode is too small
But robnotyou, I'm looking for a BIG win! 😁 Thanks so much for the quick response! It might upset my already-tuned settings, but I'll try it out.
Replies
Boosts
Views
Activity
Feb ’22