Get Filename

Hey all

I would the scripts look if I wanted to grab the number of files in a folder. I have the specific folder that the files will be in.

set myfolder to "/Users/myUser/folder1/subfolder" as alias
tell application "Finder"
set numberfiles to count of (files in folder myfolder)
end tell
tell application "FileMaker Pro Advanced
set cell "number" of current record to numberfiles
end tell

this doesnt seem to work, because finder is telling me Cant get Folder.

here is the script.

thanks
RB

Try this instead:


set myfolder to Posix file "/Users/myUser/folder1/subfolder"
tell application "Finder"
set numberfiles to count of (files in folder myfolder)
end tell
tell application "FileMaker Pro Advanced"
set cell "number" of current record to numberfiles
end tell

slashes ‘/’ are posix paths, use colons ‘:’ and file or alias

alias "Macintosh HD:Users:myUser:folder1:subfolder

or use something like

posix file "/Users/myUser/folder1/subfolder"

for posix