Hi everyone.
Does anyone know how to get the name of the user’s iDisk? For example my dot-Mac account is johnnylundy@mac.com and my iDisk is “johnnylundy”.
It seems as if this would be simple, but I have looked at all of the dictionaries, the shell, and even the entire dot-Mac SDK and I can’t figure it out.
The dot-Mac SDK seems to say that you can call a method that retrieves the dot-Mac info from the user defaults, but I do not find any defaults file that has to do with dot-Mac.
I have a email in to the dotmac people, but would appreciate if anyone knows where in the system this is kept. Just the name of the current user’s iDisk (if mounted), not anything else.
It’s not a OS X supplied name. You have to signup for a .Mac account, thus, that’s where you would get what your .Mac name is.
Once you have an account, and you enter it in the System Preferences > .Mac > Account tab, that’s where you would go to find it.
C
Model: VT N0362 2x2GHz G5; 4GB; 2x160GB; 22" Cinema; ATI 9800 Pro SE
AppleScript: 1.10.3
Browser: Safari 416.12
Operating System: Mac OS X (10.4)
I want it programmatically. I know what it is for my machine - I wanted to be able to get it for anyone who uses the script.
Anyway, I found out how to get the value of what OS X calls the “iToolsMember” key in the NSGlobalDomain of the NSUserDefaults:
For an AppleScript, it is much simpler to just use the shell command “defaults”:
try
set theiDiskName to do shell script "defaults read NSGlobalDomain iToolsMember"
on error
beep
return
end try
I got this info from a reply from dotmackit@mac.com (a very fast and accurate reply from one of the engineers). Just FYI, in case anyone needs to get this value from an Objective-C project, here is the code to get it using the NSUserDefaults object:
The “[userDefaults synchronize]” line is to make sure that the cached copy of dot-Mac info matches that on disk. Just in case the user changed something recently.
This is for a workflow that I wrote today to construct WebDAV URLs (“http”) from selected files in the Sites folder of a user’s iDisk. It’s for those who want to post image files on forums where the forum admin does not allow images to be uploaded, so they must be linked from offsite. Basically, the user selects some files in the Sites folder of the iDisk, then right-clicks (the WorkFlow is a Finder plug-in) and chooses Automator->Copy iDisk URLs, and the WorkFlow puts lines of text on the Clipboard that have the format
http ://homepage.mac.com/dotMacAccountName/filename
which can be directly pasted into a reply box on a forum, and will open the image in the viewer’s browser when clicked. I used the Python shell script trick posted here at MacScripter to encode the URL properly to convert spaces and apostrophes and etc.
If anyone would like the WorkFlow I can post it.
Model: Mac G5 Dual 2.0
AppleScript: 1.10.3
Browser: Safari 412
Operating System: Mac OS X (10.4)