Python Forum
Using pyobjc-framework-CoreServices
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using pyobjc-framework-CoreServices
#1
Trying to write a replacement for SetDefaultMailApp which implies LaunchServices but seems to be part of CoreServices now and I've installed the python module but have no idea how to import it so I can use LSSetDefaultHandlerForURLScheme
Thanks for any Python 3.11 help.
Reply
#2
Disappointed that no replies here or in other forums so went with AppleScript application:
-- defaults write as an application to set mailto handler to Outlook
-- plist is under ~/Library/Preferences/
-- osascript -e 'id of app "Microsoft Outlook"'
-- will give you the com.microsoft.Outlook
do shell script "defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add '{\"LSHandlerPreferredVersions\" = { \"LSHandlerRoleAll\" = \"-\"; };LSHandlerURLScheme=mailto;LSHandlerRoleAll=com.microsoft.Outlook;}'"
display dialog "Reboot required to take effect" buttons {"OK"} default button "OK"
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020