Hi all, hope this year has been a fruitful one for everyone…
I am in a sticky situation and can to seem to find a solution, all the scripter I have asked here in SA are also lost…
I am sure this is an easy task and I am jjust missing the boat somewhere can you guys have a look and let me know what I am doing wrong, heres the problem.
I had a shared drive on a ready NAS that has multiple folders, I.E. shared folder - Masters, inside this folder is, Backup 1, Backup 2, Backup 3, Backup 4. , Once Backup 1 reaches 4gig in size I need to change the label to orange, Backup 2 has 2 sub folders that need to be checked separately and the same needs to apply.
firstly is this possable,
secondly has this been done
thirdly can some one please help me with this.
My scripts work today then the same script does not work tomorrow, I have attached what I have gotten to work so fer but the rest is a blank.
[b]tell application “Finder”
activate
–get label index of folder (whose name begins with “DVD”) of disk “SessionArchives”
make new Finder window to disk “SessionArchives”
get label index of (every folder of front Finder window) as list
if label index is equal to 3 then
set label index of (folder of front Finder window whose size is greater than 4.0E+9) to 1
else
--set label index of (every folder of front Finder window whose size is less than 4.0E+9) to 3
end if
end tell[/b]
Any help would greatly appreciated, I am a beginner, and this is bugging me broken…
First off all: Do you have sufficient access privileges to change the labels (writing permission is required).
Second of all: It’s not necessary to open a Finder window to manipulate the contents of a folder
You can do something like this
tell application "Finder"
set currentFolder to folder "Backup1" of disk "SessionArchives"
set labelIndex to label index of currentFolder
if labelIndex is equal to 3 then
if size of currentFolder > 4.0E+9 then set label index of currentFolder to 1
end if
end tell
property folderList : {"SessionArchives:Backup1:", "disk:path:to:folder1:", "disk:path:to:folder2:"}
repeat with oneFolder from 1 to (count folderList)
tell application "Finder"
set currentFolder to folder (item oneFolder of folderList)
set labelIndex to label index of currentFolder
if labelIndex is equal to 3 then
if size of currentFolder > 4.0E+9 then set label index of currentFolder to 1
end if
end tell
end repeat
or
.
repeat with oneFolder from 1 to (count folderList)
tell application "Finder"
tell folder (item oneFolder of folderList)
if label index is equal to 3 and size > 4.0E+9 then
set label index to 1
end if
end tell
end tell
end repeat