How to get the default web browser of current user through AppleScript ?
Hi everybody!
I contact you for the following question:
How to get the default web browser of current user through AppleScript?
I would like to create a script that checks the default web browser of the person using my program.
Also, I would like to check what is the default download folder of the found browser.
Why would you do that? You might say.
It's quite simple, I would like to find a file with a specific name in the download folder, but I actually realize that it's not necessarily the ideal solution...
That's why, if possible, I would simply like to search all files on all mac hard drives (internal or external) of a file name or keyword (the keyword "Paladium" in my case) and save the path in a variable ("paladiumLauncherPath" in my case).
Sorry for the quality of the English in my message, I am French and I used an automatic translator to send it to you.
I would like to point out that I am new to Apple scripts.
Here's what I've already tried to find the default download folder for Safari (code found on an old topic in this forum):
tell application "Finder"
set paladiumLauncherPath to do shell script "defaults read com.apple.safari DownloadsPath"
if paladiumLauncherPath = "~" or paladiumLauncherPath starts with "~/" then ¬
set paladiumLauncherPath to text 1 thru -2 of POSIX path of (path to home folder) & rest of characters of paladiumLauncherPath
open POSIX file paladiumLauncherPath as alias
activate
end tell
But I'm lucky to get this error message:
error "Erreur dans Finder : 2019-02-03 13:57:15.548 defaults[15168:407110]
The domain/default pair of (com.apple.safari, DownloadsPath) does not exist" number 1
-Milan
MacBook Air 13", 10.14