Reputation: 6181
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?
Upvotes: 3
Views: 3034
Reputation: 11238
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
Upvotes: 5