I'm having some trouble with an applescript, it is designed to simply let the user select an folder, and then copy a folder from the same directory as the script into the chosen folder (recursively.) This should be dirt simple, but I'm an Applescript n00b
Both the paths in the error message exist, so I'm probably misunderstanding a command.
Code:
set targetDir to choose folder default location "/Applications" with prompt "Please select the program directory:"
set imageDir to ParentFromPath(path to me, true) & "images"
tell application "Finder"
copy folder imageDir to folder (targetDir)
end tell
on ParentFromPath(thePath, wantPath)
set thePath to (thePath as text)
set saveDelim to AppleScript's text item delimiters
set AppleScript's text item delimiters to {":"}
set pathAsList to text items of thePath
if the last character of thePath is ":" then
set idx to (the number of text items in thePath) - 2
else
set idx to -2
end if
if wantPath then
set folderName to ((text items 1 through idx of pathAsList) as text) & ":"
else
set folderName to item idx of pathAsList
end if
set AppleScript's text item delimiters to saveDelim
return folderName
end ParentFromPath
Finder got an error: Cant set folder (alias "Mac HD:Applications:Test App:") to folder "johndoe:dev:workspace:images".