Thanks Rodger, now it works:
on alfred_script(q)
set defaultPath to "SYSTEM:Users:fns:Dropbox:URL" as alias
tell application "Safari" to set theName to name of front document
tell application "Safari" to set theURL to URL of front document
set theName to replace_chars(theName, ":", " -")
tell application "Safari"
activate
set resultFile to (choose file name with prompt "Save .webloc File" default name theName default location defaultPath) as text
-- if resultFile does not end with ".webloc" then set resultFile to resultFile & ".webloc"
end tell
set text item delimiters to ":"
set fileName to last text item of resultFile
set filePath to text 1 thru lastpos(resultFile, ":") of resultFile
tell application "Finder" to make new internet location file at filePath to theURL with properties {name:fileName}
end alfred_script on replace_chars(this_text, search_string, replacement_string) set AppleScript's text item delimiters to the search_string set the item_list to every text item of this_text set AppleScript's text item delimiters to the replacement_string set this_text to the item_list as string set AppleScript's text item delimiters to "" return this_text end replace_chars on lastpos(textstring, thischar) return (length of textstring) - (offset of thischar in (reverse of text items of textstring as string)) end lastpos