"._" files Dot underscore files and shell script h

I am trying to avoid copying dot underscore files to a PC volume mounted under OSX.2
i found an article on the web http://developer.apple.com/techpubs/macosx/Essentials/SystemOverview/Finder/chapter_10_section_15.html

that describes why the files are copied but not how to not copy them i have never done any shell scripting and wanted to know if that would be better for copying my files to pc volumes

try
		move (every file of folder "Move to Enlarged") to folder "WEBTEAM:Images:Products:Enlarged:"
		
		delete every item of folder "Move to Enlarged"
	on error
		display dialog "there was an error copying to 'webteam/images/products/enlarged'"
	

this is a snpiet of the code i am using now
any help would be greatly appreciated

There’s several ways of omitting these files from the move command. One is:

move (every file of folder “Move to Enlarged” whose name does not start with “.”) to folder…

Note that you can use any conditional statement to narrow the selection.

Also, be aware of the differences in ‘items’ and ‘files’ as far as the Finder is concerned.

In your first line, you move “every file”, then you delete “every item”.

every file will only include files whereas every item will include folders as well as files . This means your script will delete folders even if you haven’t taken account of the files within them.

Thanks
that will work

but my question still remains if using the shell script would be better
of course when you ask a forum of users which is better you always get 100 different ideas or ways of doing things

thanks again camelot

Sorry, I thought you were looking for a critique of your code with respect to the hidden files, rather than asking for an AppleScript vs. shell script analysis.

Of course, the right answer is “whichever one works for you” :slight_smile:

From a readability point of view, even the most badly-formed AppleScripts beat most shell scripts hands down, but shell scripting has more value in a mixed computing environment.

Of course, you can always combine the two… AppleScript has the ability to execute shell commands:

do shell script "cd /path/to/Move to Enlarged/; mv * /WEBTEAM/images/Products/Enlarged/"

:slight_smile:

i tried to copy and paste this code

do shell script "cd /path/to/Move to Enlarged/; mv * /WEBTEAM/images/Products/Enlarged/"

but to no avail