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: "L. Lee" <email@hidden>
- Date: Thu, 20 Dec 2012 22:29:57 -0600
- Thread-topic: How do you know if the folder is Shared
On 12/20/12 10:17 PM, "Robert Poland" <email@hidden> wrote:
>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.
tell application "Finder"
get folder of window 1 as alias
end tell
>
>2. What is the function of the variable "er" after the on error statement?
>
My bad, just left over from testing (I don¹t have Script Debugger).
Regards,
Laine
>
>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