• 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: programmatically get path to iDisk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: programmatically get path to iDisk


  • Subject: Re: programmatically get path to iDisk
  • From: Mark Myers <email@hidden>
  • Date: Thu, 6 Dec 2007 18:23:40 -0700

Stefan:

My bad. I misunderstood your post. Be that as it may, in playing with this, I found out (at least on my test machine: haven't been able to verify elsewhere) that the Finder recognizes the iDisk by the .Mac username regardless of whether the volume is local or remote. So this code:

tell application "Finder"
	set theDisk to disk "<.Mac username>" as alias
	set thePath to POSIX path of theDisk
end tell

returns the correct path regardless.

Mark J. Myers

On Dec 6, 2007, at 8:44 AM, Stefan Seiz wrote:

On 06.12.2007 16:03 Uhr "Mark Myers" <email@hidden> wrote:

Stefan:

I haven't had time to test this, but if you know the name of the
volume, you may be able to check the "local volume" property of the
disk to determine this. Try the following:

tell application "Finder"
set theDisk to disk "<disk name>"
set localTest to local volume of theDisk
end tell

The local volume property is a boolean value.

Mark J. Myers

Thanks, for the quick reply. But not knowing the Name of the volume is the
problem i want to solve here ;-)


As i said depending on wether the user syncs the idisk, the volume name
differs. I believe via Webdav an iDisk will always be mounted as
/Volumes/.macusername while a local copy of the iDisk will always be mounted
as /Volumes/iDisk. Can someone confirm this?


Example mount output:
/dev/disk2s2 on /Volumes/iDisk (local, nodev, nosuid, journaled, mounted by
seiz)
http://idisk.mac.com/seiz/ on /Volumes/seiz (nodev, noexec, nosuid, mounted
by seiz)


The problem further is, even though the Finder will show an item named iDisk
in the sidebar, clicking that item might in fact mount a volume via webdav
which is named like the users .mac username.


So even
tell application "Finder"
set pathToiDisk to POSIX path of (disk "iDisk" as alias)
end tell
will not work reliably as disk iDisk might not exist allthough the Finder's
UI might lead you to believe so.


Now i could go ahead and parse the output of the unix mount command in AS,
but that is just plain ugly and there must be an easier, reliable way.


--
Stefan Seiz <http://www.StefanSeiz.com>
Spamto: <email@hidden>



_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Prev by Date: Line Wrap - Fit to window
  • Next by Date: Re: Finder inconsistency (Was: What makes AppleScript difficult)
  • Previous by thread: Re: programmatically get path to iDisk
  • Next by thread: Re: What makes appleScript so easy
  • Index(es):
    • Date
    • Thread