• 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: How do you know if the folder is Shared
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • How do you know if the folder is Shared? Page 2
      • From: Robert Poland <email@hidden>
References: 
 >Re: How do you know if the folder is Shared (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: How do you know if the folder is Shared
  • Next by Date: Re: How to modify Grid Spacing ?
  • Previous by thread: Re: How do you know if the folder is Shared
  • Next by thread: How do you know if the folder is Shared? Page 2
  • Index(es):
    • Date
    • Thread