Le 07/08/2012 à 09:50, emile.a.schwarz <
email@hidden> a écrit :
Hi all,
in a working script - the folders are created in a repeat loop - the label index is not set.
Code:
make new folder at front window with properties {name:FldrName, label index:6}
But, if I add after that line:
set label index of the result to 6
I've got my label index.
Am I doing something wrong
Yes you do.
To be able to set the label index, the folder must exist which is not the case in your code.
set FldrName to "Émile"
tell application "Finder"
set leDossier to make new folder at front window with properties {name:FldrName, label index:6}
--> folder "Émile Schwarz" of folder …
label index of leDossier
--> 0
set label index of leDossier to 6
--> 6
label index of the leDossier
--> 6
end tell
set FldrName to "Émile Schwarz"
tell application "Finder"
make new folder at front window with properties {name:FldrName}
--> folder "Émile Schwarz" of folder …
set label index of result to 6
--> 6
end tell
Yvan KOENIG (VALLAURIS, France) mardi 7 août 2012 10:04:35