Reputation: 598
I'm trying to make my add-on save bookmarks in it's own bookmark folder.
This function created the desired folder, but I want it to return the id of the existing folder instead of forever making millions of new ones if it can find it by name:
function special_bookmark_folder()
{
menuFolder = bmsvc_service().bookmarksMenuFolder;
// <Try and find the bookmark folder here!>
return bmsvc_service().createFolder(menuFolder, ":: Bookmarkr ::", bmsvc_service().DEFAULT_INDEX);
// else return id of existing folder if it's found here
}
Upvotes: 0
Views: 197
Reputation: 5054
You have to use the Places query APIs, which isn't the most straightforward task. Thankfully there is an example with exactly what you want
Upvotes: 1