I seek script to switch between two screens...

I´m an Applescript beginner!

How can I move files contains ex. “606” to a folder?

What´s wrong?
tell application “Finder”
move (every file of “startup disk” whose name contains 606) to folder “Annas HD:Skannat Anna:Poster”
end tell

Tomaz

Hi, Tomaz. You seem to have the quote marks in the wrong places. Try it like this:

tell application "Finder" 
  move (every file of startup disk whose name contains "606") to folder "Annas HD:Skannat Anna:Poster" 
end tell

Thanks!

Can I do lilke this?

tell application “Finder”
move (every file of “Annas HD:Skannat Anna:kalender”" disk whose name contains “606”) to folder “Annas HD:Skannat Anna:Poster”
end tell

Hi all :slight_smile:
Here one suggestion:

tell application "Finder"
	try
		--The first variable with the path of the source folder (as alias)
		set SourceFolder to "Annas HD:Skannat Anna:kalender:" as alias
		
		--The second variable with the path of the destination folder (as alias)
		set DestinationFolder to "Annas HD:Skannat Anna:Poster:" as alias
		
		--The move instruction
		move (every file of SourceFolder whose name contains "606") to DestinationFolder
		
	on error ErrorMessage
		display dialog ErrorMessage with icon 0
	end try
end tell

:wink:

Not quite. You have to write ‘folder’ in front of “Annas HD:Skannat Anna:kalender” - not ‘disk’ after it. Or you can use aliases, as Fredo has suggested.

If there are already items in the destination folder with the same names as the files you’re moving - and you want the moved files to replace them - you can specify this too:

tell application "Finder"
  move (every file of folder "Annas HD:Skannat Anna:kalender" whose name contains "606") to folder "Annas HD:Skannat Anna:Poster" with replacing
end tell