Jump to content
Welcome to InsanelyMac Forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.


Just Joined
  • Content count

  • Joined

  • Last visited

About magdan

  • Rank
    InsanelyMac Protégé
  1. Hi, Il wil really appreciate any help for this! Thansk to whomever had the patience to read my question! I wish that someone could help me in writing an Apple Script to limit access to a specific folder, by that, I mean, to change the Ownership & Permissions of that folder (in it's get Info) to : no Access this would only be a dissuasive means of opening this folder. As far as now (I'm an absolute beginner in AppleScript), I've wrote a script to promt a dialog asking for a password… What I wish to do is : 1. Attach the AppleScript to the specific folder (so, when an intruder doubleclicks on it, the Apple Scripts starts) 2. Ask for a password for that specific folder with a (repeat twice) 3. If the answer is right, than, modifiy the Ownership & Permission to : Read and Write (and make the folder visible if it was hidden) 4. Else (if these are already in : Read and Write) change the Ownership & Permission to : No Access (for everyone : Owner, Group, Others) 5. And, (in the Else) if the answer is wrong, hide the folder. 6. And finally, (if the answer is right) restore everything to normal (reset pribileges and visibility)… Here is the result of what I could understand from Apple Script : set prompt to "Password?" repeat 3 times set dialogResult to display dialog prompt ¬ buttons {"Annuler", "OK"} default button 2 ¬ default answer "Wrong" with icon 1 with hidden answer set thePassword to text returned of dialogResult if thePassword is "pass" then exit repeat else if thePassword is not "pass" then display dialog "Wrong" end if end if end repeat if thePassword = "pass" then display dialog "OK" end if So, to resume : 1. How does one attache a script to a specific folder (or item)? 2. How can an Apple Script access the "Ownership & Permission" (in the Get Info, of that specific folder or item) and changes its values? 3. How can an Apple Script restore (or reset) these values to their original state? I'm French and I spent two days reading (searching really!) the English Apple Script Language Guide… trying to create a dissuasive Script to prevent my kid's friends to acces some of my folders with whatever I could gather. But this doesn't look like a friendly and intuitive Guide to me…! Thanks for any help! Dan