Re: Finder script to move files
Re: Finder script to move files
- Subject: Re: Finder script to move files
- From: Andrew Oliver <email@hidden>
- Date: Fri, 28 May 2004 17:47:40 -0700
There are three problems with your script.
First is that if you're quoting a path you need to enclose it in quotation
marks, otherwise AppleScript will assume it's a variable or other
AppleScritp object.
Secondly, for historical reasons, the Finder requires Mac-style path names
(i.e. colon-delimited), not unix-style (/-delimited).
Lastly, when moving files you need to tell the Finder where to move them to
- the keyword 'to' is required.
Therefore your script should look like:
tell application "Finder"
move every file of folder "Macintosh HD:Users:admin:Public:Proof HP
folder" to folder "Macintosh HD:Applications:HP Designjet:RIP:Hot Folders:"
end tell
Now, additionally, if you want this to be a folder action, you should change
it so that it reacts to the items dropped in the folder rather than every
file in the folder. It's not an absolute requirement, but it does make the
script a little smarter.
Andrew
:)
On 5/28/04 1:15 PM, "Matt Beals" <email@hidden> wrote:
>
This is what I had come up with. But I don't know the proper syntax. I would
>
think something to this effect would enable me to attach a folder action to
>
"Proof HP". Don't laugh too loud, I'm new to this ;)
>
>
tell application "Finder"
>
move every file of folder Users/admin/Public/Proof HP
>
folder Applications/HP Designjet/RIP/Hot Folders/
>
end tell
>
>
Thanks for the help!
>
>
On 5/27/04 4:39 PM, "Graff" <email@hidden> wrote:
>
>
> Here's an example script:
>
> ----
>
> on open (theItems)
>
> tell application "Finder"
>
> set targetFolder to folder ((path to applications folder from
>
> system domain as string) & "Test")
>
> repeat with anItem in theItems
>
> move anItem to targetFolder
>
> end repeat
>
> end tell
>
> end open
>
> ----
>
>
>
> This script doesn't check for duplicates and you have to change the
>
> "Test" part to the actual path within the Applications folder. Other
>
> than that it works fine.
>
>
>
> - Ken
>
>
>
> On May 27, 2004, at 2:07 PM, Matt Beals wrote:
>
>
>
>> I cannot seem to find a finder/folder script to move a file from one
>
>> folder
>
>> to another automatically. Does anyone have a script that does this?
>
>> The deal
>
>> is I need to have a script that I can attach to a folder in my public
>
>> folder
>
>> that will move a PDF or PS file to a folder inside my applications
>
>> folder so
>
>> the RIP can process the job.
>
> _______________________________________________
>
> 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.
>
>
>
>
>
>
>
>
>
Matt Beals
>
Director of Manufacturing and Production
>
Paizo Publishing, LLC
>
(425) 289-1343
>
mailto:email@hidden
>
http://www.paizo.com
>
_______________________________________________
>
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.
_______________________________________________
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.