Gokväll
Varför funkar inte min kod?
Bildfil "4.tif" finns i en av tre undermappar i mappen "Test_mapp".
Koden replikerar bara dialogrutan med ordet "Nej".
Tacksam för svar
Erland Segerstedt, Kusmark
---------------------- kod -------------------------------
set bildNr to "4"
set cdSkiva_Lager to alias "dator:Users:home:Desktop:Test_mapp:"
tell application "Finder"
set listofFolders to the name of every folder of folder cdSkiva_Lager
set listofFiles to the name of every file of cdSkiva_Lager
end tell
tell application "Finder"
set numOfFolders to (count listofFolders)
set numOfFiles to (count listofFiles)
repeat with i from 1 to numOfFolders
set cdSkivans_mappNamnet to get ((the name) in item i) of cdSkiva_Lager
tell application "Finder"
if (exists (file (bildNr & ".tif") of (alias cdSkivans_mappNamnet))) then
set fileFound to true
display dialog "Ja"
else
set fileFound to false
display dialog " Nej"
end if
end tell
end repeat
end tell
---------------------- slut kod -------------------------------