Hello,
Is it possible to use AppleScript to rename an existing bookmark?
I’ve tried getting a bookmark and then setting the name to something new, and also just creating a new bookmark via make bookmark with properties
having the same url as an existing, but neither method seems to work. The change is visible within the script, but not in Hook itself (meaning that the existing bookmark retains the old name in Hook, and no new bookmark is created either).
Using set name of
(myVar is the url of an existing bookmark), returns “Test”:
tell application "Hook"
set _mark to make bookmark with data myVar
if _mark is missing value then
return "Failed to create bookmark for myVar"
else
set name of _mark to "Test"
return name of _mark
end if
end tell
Using make bookmark with properties
(myVar is the url of an existing bookmark), returns “Test”:
tell application "Hook"
set _mark to make bookmark with properties {address:myVar, name:"Test"}
if _mark is missing value then
return "Failed to create bookmark for myVar"
else
return name of _mark
end if
end tell
Should this be possible, or am I going about it the wrong way? Thanks.