Re: Moving files from desktop to User folders
Re: Moving files from desktop to User folders
- Subject: Re: Moving files from desktop to User folders
- From: Mr Tea <email@hidden>
- Date: Sun, 05 Jan 2003 17:21:16 +0000
This from phildobbin - dated 05-01-03 03.04 pm:
>
tell application
>
"Finder.app"
>
copy file "CGI script" of desktop to "Documents"
>
end tell
>
>
ScriptDebugger gives me a:
>
>
`Can't set "Documents" to file "CGI script" of desktop. Access not allowed.'
>
>
And an Applescript error -10003 when trying to compile.
>
>
Any ideas (I'm logged in as an administrator and have permissions set
>
correctly [0700])?
>
>
Regards,
>
>
Phil.
For copying items in the finder, you need 'duplicate', not copy.
Also, you need to be more specific about what "Documents" is, otherwise AS
just doesn't have a chance. That's like trying to send someone a letter and
only putting their name on the envelope.
Try this:
tell application "Finder"
set theDest to ((path to current user folder) as string) & "Documents:"
duplicate file "CGI script" of desktop to folder theDest
end tell
Note the colon after 'Documents'. Folder names at the end of a path are
always followed by a colon (or slash in a POSIX path).
HTH
Mr Tea
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.