// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // // Creation Date: June 13, 1997 // // Description: // This a helper script which will edit the name of a bookmark // // Input Arguments: // The name of the bookmark to edit // // Return Value: // None. // global proc editBookmark (string $bookmark) { // And make sure the bookmark exists // if (catch (`sets -query -text $bookmark`)) { error (uiRes("m_editBookmark.kBookmarkNotFound")); } string $OK = (uiRes("m_editBookmark.kOk")); string $delete = (uiRes("m_editBookmark.kDelete")); string $cancel = (uiRes("m_editBookmark.kCancel")); // Now put a prompt dialog so the name can be edited // string $response = `promptDialog -title (uiRes("m_editBookmark.kEditBookmark")) -message (uiRes("m_editBookmark.kBookmarkName")) -text $bookmark -button $OK -button $delete -button $cancel -defaultButton $OK -cancelButton $cancel -dismissString $cancel`; if ($response == $OK) { // // If the user is happy, then edit the bookmark // string $name = `promptDialog -query -text`; rename $bookmark $name; } else if ($response == $delete){ // // Delete the bookmark // delete $bookmark; } }