Is there any easy way of updating the macro so that is creates an HTML shortcut on the desktop instead of a webloc file?
I'm asking as with Ventura 13.1 Apple are at the moment forcing any links saved on the desktop to be opened in Safari and this can't be changed. The only work around is to 'right click and select open with' which is rather a pain to work with.
If the shortcuts were HTML links then it truly makes them browser agnostic.
Do you have a working example of one of these HTML link files?
I'm not familiar with them.
I’m still running macOS 10.14.6 Mojave, so if it's anything to do with the new Shortcuts App I can't help.
Strange that Apple would enforce .webloc files opening in Safari. Microsoft got in quite hot water over similar highhandedness a number of years ago.
It might be better to work with standard .webloc files, since that's what is formed by drag and drop.
See if this works to open the selected .webloc file in Google Chrome:
--------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2022/12/16 05:23
# dMod: 2022/12/16 05:23
# Appl: Finder
# Task: Open Selected WebLoc File in the Given Web Browser.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Finder, @Open, @Selected, @WebLoc, @Web, @Browser
--------------------------------------------------------
# Safari's ID ⇢ com.apple.Safari
--------------------------------------------------------
property browserAppIDStr : "com.google.Chrome"
try
tell application "Finder"
set finderSelectionList to selection as alias list
if length of finderSelectionList = 0 then error "No files were selected in the Finder!"
set weblocFileAlias to item 1 of finderSelectionList
if class of (file weblocFileAlias) = internet location file then
set appRef to application file id browserAppIDStr
open weblocFileAlias using appRef
else
error "The Selected File Was NOT a WebLoc File!"
end if
end tell
on error errMsg number errNum
set errMsg to errMsg & linefeed & linefeed & "Num: " & errNum
if errNum ≠ -128 then
try
tell application (path to frontmost application as text) ¬
to set ddButton to button returned of ¬
(display dialog errMsg with title ¬
"ERROR!" buttons {"Copy Error Message", "Cancel", "OK"} ¬
default button "OK" giving up after 30)
if ddButton = "Copy Error Message" then set the clipboard to errMsg
end try
end if
end try
--------------------------------------------------------
Attached should be a zip file containing a HTML file.
On the script file you've provided how would I change it to see if it worked with Brave? (I don't / won't ) have Chrome on my machines I assume it's an AppleScript file?
There are a lot of folks complaining about this issue here.
Hi Chris I've just tried the script and changed the ID to brave and if I run it I just get an error message saying "The Selected File Was NOT a WebLoc File! Num: -2700" I wasn't given any option to select a file? Also tried it with compiling it as an application, still nothing.
Okay I'll have a look at the macro, I guess I need to work out how wrap the URL in the HTML and then save it out as a 'HTML' extension instead of 'webloc'?
Brilliant Chris my thanks. I've looked to change the output to '~/Desktop/%Variable%local_PageName%.html to get it to save to the desktop, but that doesn't work. Any ideas?