I am currently setting up an ApplescriptObjC application. Whenever I try other methods, it screws up. I'm trying to set it up where a shell script uses the mv command to move a file from the "Files" directory to the /usr/bin/ folder. I think it would go a little something like: do shell script "sudo mv " & path & "/Files/ /usr/bin/"
where path would be the path to me. I have tried the path to me and posix and other stuff, just doesn't work. ![The Files folder contains a file I want to move to /usr/bin] Image of where the folder is: https://i.stack.imgur.com/jUX6w.png
ApplescriptObjC Path To Folder
252 views Asked by Nick Daria At
1
First of all the folder
Files
in your screenshot is a virtual folder in Xcode (yellow). You have to create a real folder (blue). The easiest way is to drag a folder in Finder to the Xcode sidebar and select "Create folder references"To use
sudo
in AppleScript appendwith administrator privileges
to thedo shell script
line. You will be prompted to enter an admin password.This code moves(!) the files to
/usr/bin
. If you want to copy (duplicate) the files usecp -r
instead ofmv