Using an "if not exists" command with a folder on an SMB share
I'm trying to use an "if not exists" command on a folder which is stored on a mounted smb share..
This part of my script is supposed to check if a folder exists and;
If it does - Skip to the next part of the script
If it doesn't - Create the folder.
At the moment it either errors saying that the folder doesn't exist or doesn't create the folder.
I can get this script to work fine using local folder paths but I want to do it on an SMB share..
Here's my script.
Many thanks in advance.
Martin
-----------
set username to (do shell script "whoami")
set Media to " Media Files"
mount volume "smb://172.22.8.23/macmedia$"
tell application "Finder"
if not (exists ("smb://172.22.8.23/macmedia$/" & username as text) & Media as text) then
make new folder at "macmedia$" with properties {name:(username as text) & Media as text}
end if
end tell
tell application "Finder"
set mnt to ("smb://172.22.8.23/macmedia$/" & username as text) & Media as text
try
mount volume mnt
end try
eject "macmedia$"
end tell
------------------