Re: Acquiring the Dropbox Folder Path -- was: Re: Error -10000 for one user
Re: Acquiring the Dropbox Folder Path -- was: Re: Error -10000 for one user
- Subject: Re: Acquiring the Dropbox Folder Path -- was: Re: Error -10000 for one user
- From: "Stockly, Ed" <email@hidden>
- Date: Wed, 27 Apr 2016 00:50:43 +0000
- Thread-topic: Acquiring the Dropbox Folder Path -- was: Re: Error -10000 for one user
>Olof had indicated that with a two Dropbox setup one would be named
>Dropbox (Personal) and one would be named Dropbox (Business name).
>However on the machine in my dept. that has two Dropboxes her personal
>Dropbox is just named Dropbox and the business one is named Dropbox
>(Comtech).
Since the name is included with the path, this script doesn't care what
the name is, and should work even if there are more than two (which,
apparently, is possible).
set dropBoxJsonFile to "~/.dropbox/info.json"
tell application "System Events" to set dropBoxJsonFile to POSIX path of
disk item dropBoxJsonFile
set dropBoxInfo to read dropBoxJsonFile
set AppleScript's text item delimiters to {"{\"path\": \"", "\", \"host\":
"}
set dropboxPaths to text items of dropBoxInfo
set dropBoxPathList to {}
repeat
if the (count of dropboxPaths) < 2 then exit repeat
set dropboxPaths to the rest of dropboxPaths
set the end of dropBoxPathList to item 1 of dropboxPaths
set dropboxPaths to the rest of dropboxPaths
end repeat
return dropBoxPathList
>
_______________________________________________
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