The following script works on some folders and some folders I get this error:
“mkdir: folder: Permission denied”
Anyway around this? Any information would be greatly appreciated.
Thanks,
CarbonQuark
tell application "Finder"
select the front Finder window
set targetFolder to insertion location as alias
set folderPath to POSIX path of targetFolder
end tell
set makeBannerFolders to "mkdir -p " & folderPath & "/{JOB' 'FOLDER1/FOLDER/{SUB1/SUB1A,SUB2,SUB3,SUB4},FILES,RAW/{SUB1,SUB2/{SUB2A,SUB2B}},JOB' 'FOLDER2}/"
do shell script makeBannerFolders
Have you checked the read/write permissions on the enclosing folder? You can do this by selecting the folder, pressing Cmd-I and look at the Sharing and Permissions section.
Also I had an issue because the folder path had a space in it. To get around this I used ‘quoted form of’ to enclose the folderPath string with quotes. Without this it was writing to the root folder, perhaps your current user does not have write permissions to the root folder.
tell application "Finder"
select the front Finder window
set targetFolder to insertion location as alias
set folderPath to POSIX path of targetFolder
end tell
set makeBannerFolders to "/bin/mkdir -p " & quoted form of folderPath & "/{JOB' 'FOLDER1/FOLDER/{SUB1/SUB1A,SUB2,SUB3,SUB4},FILES,RAW/{SUB1,SUB2/{SUB2A,SUB2B}},JOB' 'FOLDER2}/"
do shell script makeBannerFolders