Monday, December 11, 2017

#1 2017-08-14 08:39:30 am

Osmosis
Member
Registered: 2006-12-29
Posts: 37

Unlock all files but for a specific folder

Hi, all,

I'm struggling to find the answer to this one. I have two folders that will always have some locked files in them. I'm trying to create a script that will unlock any locked files in those two folders.

I've found scripts that will unlock anything selected, or unlock files from the path given by a prompt window. But I can't work out how to simply put the path into the script.

Applescript:

tell application "Finder"
   set thepath to POSIX path of "/Users/username/Desktop/Mobius Locked/"
   set locked of every item of entire contents of thepath to false
end tell

Also tried a variation:

Applescript:

set thepath to POSIX path of "/Users/username/Desktop/Mobius Locked/"
tell application "Finder" to set theFiles to files of folder thepath
tell application "Finder"
   set locked of every item of theFiles of thepath to false
end tell

Would be awesome if someone could help. I'm sure it's simple, just not for me.

Offline

 

#2 2017-08-14 11:18:59 am

Osmosis
Member
Registered: 2006-12-29
Posts: 37

Re: Unlock all files but for a specific folder

Stumbled upon the answer:

Applescript:

Tell application "Finder"
   set locked of every item of folder "Macintosh HD:Users:username:Desktop:Mobius Locked:" to false
end tell

Hope this helps someone else.

Last edited by Osmosis (2017-08-14 11:19:24 am)

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)