I've created directory structure and placed the a file in A directory:
~/A
~/B
In AppleScript I'm trying to move file a from A to B. Here is my code:
on run
tell application "Finder"
move POSIX file "~/A/a" to POSIX file "~/B"
end tell
end run
But when I run the script I get error:
error "Finder got an error: Handler can’t handle objects of this class." number -10000
This is simplified version of my problem. Can anybody help me please?
Try:
set myFile to POSIX file (POSIX path of (path to home folder) & "A/a.txt")
set myFolder to POSIX file (POSIX path of (path to home folder) & "B")
tell application "Finder" to move myFile to myFolder
Or:
set myFile to (path to home folder as text) & "A:a.txt"
set myFolder to (path to home folder as text) & "B"
tell application "Finder" to move myFile to myFolder
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With