Re: How do you know if the folder is Shared
Re: How do you know if the folder is Shared
- Subject: Re: How do you know if the folder is Shared
- From: Robert Poland <email@hidden>
- Date: Thu, 20 Dec 2012 21:17:59 -0700
Thanks Laine,
Looks promising.
Two questions;
1. I'm dealing with Finder window 1 and I'm having trouble getting the path to that folder.
2. What is the function of the variable "er" after the on error statement?
On Dec 20, 2012, at 9:03 PM, "L. Lee" <email@hidden> wrote:
> On 12/20/12 4:07 PM, "Robert Poland" <email@hidden> wrote:
>
>> Sounds impossible.
>
> Maybe not, because you only have to run one check at each level. I just picked up where we left off so this could probably be shortened:
>
> ------
> set my_chosen_folder to (choose folder with prompt "Choose a folder to check its sharing status…")
> set P to quoted form of (characters 1 thru -2 of (POSIX path of my_chosen_folder) as string)
> if length of (do shell script "/usr/bin/dscl . search /SharePoints dsAttrTypeNative:directory_path" & space & P) is not 0 then
> display dialog "The folder \"" & (name of (info for my_chosen_folder)) & "\"" & space & "is shared." buttons {"OK"} default button 1
> else
> tell application "Finder"
> set P to container of my_chosen_folder
> end tell
> try
> repeat
> set Q to quoted form of (characters 1 thru -2 of (POSIX path of (P as alias)) as string)
> if length of (do shell script "/usr/bin/dscl . search /SharePoints dsAttrTypeNative:directory_path" & space & Q) is not 0 then
> display dialog "The folder \"" & (name of (info for my_chosen_folder)) & "\"" & space & "is shared." buttons {"OK"} default button 1
> exit repeat
> end if
> tell application "Finder"
> set P to container of (P as alias)
> end tell
> end repeat
> on error er
> display dialog "The folder \"" & (name of (info for my_chosen_folder)) & "\"" & space & "is not shared." buttons {"OK"} default button 1
> end try
> end if
> ------
>
> Laine Lee
Robert Poland - Fort Collins, CO
_______________________________________________
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