• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Where are Xcode 4.1 bookmarks stored? [SCRIPTS]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Where are Xcode 4.1 bookmarks stored? [SCRIPTS]


  • Subject: Re: Where are Xcode 4.1 bookmarks stored? [SCRIPTS]
  • From: Bill Cheeseman <email@hidden>
  • Date: Tue, 09 Aug 2011 07:28:22 -0400


On Aug 8, 2011, at 5:58 AM, Bill Cheeseman wrote:

On Aug 8, 2011, at 2:24 AM, Ron Hunsinger wrote:

defaults read com.apple.dt.xcode kDSMBookmarkManagerAllBookmarksUserDefaultsKey

You may have to wait a minute or so after adding a bookmark before it shows up, but I added a bookmark to a document I know I would never have bookmarked before, and it showed up at that location about 30 seconds later.

Ah, thank you! I knew the bundle identifier for Xcode 4.1 had that extra .dt in it, but my memory failed to remind me that I should therefore look for a preference file with the same .dt in its file name.

And, in case anybody might find them useful, here are my two AppleScript scripts to archive and restore Xcode 4 bookmarks. Tested only on Xcode 4.1.

-- Xcode 4 Bookmarks-Archive
-- Version 1.0 Bill Cheeseman 2011-08-08

property xcodePrefsPath : (path to preferences as string) & "com.apple.dt.Xcode.plist"
property bookmarksKey : "kDSMBookmarkManagerAllBookmarksUserDefaultsKey"

tell application "System Events" to get (exists property list item bookmarksKey of property list file xcodePrefsPath)
if result is false then
activate
display alert "No bookmarks available" message "Xcode contains no bookmarks."
return
end if

activate
set bookmarksFile to choose file name with prompt "Archive Xcode 4 bookmarks to:" default name "Xcode 4 Bookmarks.txt" default location (path to desktop)
set fileRef to open for access bookmarksFile with write permission
try
tell application "System Events" to set bookmarks to value of property list item bookmarksKey of property list file xcodePrefsPath
write bookmarks to fileRef
close access fileRef
on error errMsg number errNum
activate
display alert "Error " & errNum message errMsg
close access fileRef
end try

==============

-- Xcode 4 Bookmarks-Restore
-- Version 1.0 Bill Cheeseman 2011-08-08

property xcodePrefsPath : (path to preferences as string) & "com.apple.dt.Xcode.plist"
property bookmarksKey : "kDSMBookmarkManagerAllBookmarksUserDefaultsKey"

if running of application "Xcode" then
activate
display alert "Xcode is running" message "Quit Xcode and run the Restore Xcode 4 Bookmarks script again" buttons {"OK"} default button "OK"
return
end if

tell application "System Events"
get (exists property list item bookmarksKey of property list file xcodePrefsPath)
if result is false then
set newPrefsItem to {|kDSMBookmarkManagerAllBookmarksUserDefaultsKey|:{}}
tell contents of property list file xcodePrefsPath
set originalValue to value
set value to originalValue & newPrefsItem
end tell
end if
end tell

activate
set bookmarksFile to choose file with prompt "Restore Xcode 4 bookmarks from:" default location (path to desktop)
set fileRef to open for access bookmarksFile
try
set bookmarks to read fileRef as list
tell application "System Events" to set value of property list item bookmarksKey of property list file xcodePrefsPath to bookmarks
close access fileRef
on error errMsg number errNum
close access fileRef
activate
display alert "Error " & errNum message errMsg
end try

-- 

Bill Cheeseman - email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Where are Xcode 4.1 bookmarks stored? (From: Bill Cheeseman <email@hidden>)
 >Re: Where are Xcode 4.1 bookmarks stored? (From: Ron Hunsinger <email@hidden>)
 >Re: Where are Xcode 4.1 bookmarks stored? (From: Bill Cheeseman <email@hidden>)

  • Prev by Date: Xcode 3.2 problems debugging on Lion?
  • Next by Date: Re: Xcode 3.2 problems debugging on Lion?
  • Previous by thread: Re: Where are Xcode 4.1 bookmarks stored?
  • Next by thread: Custom Compiler in Xcode 4.1
  • Index(es):
    • Date
    • Thread