How to move documents due to name in AppleScript edit
So I've been trying to move documents due to name, from my desktop into a different folder in AppleScript edit but all my tries have managed to do nothing. If anyone can help that would be great.
So I've been trying to move documents due to name, from my desktop into a different folder in AppleScript edit but all my tries have managed to do nothing. If anyone can help that would be great.
So how would you do this in applescript?
Your question is extremely vague - there are a gazillion and one different ways you might want to sort/filter the files, but in general you can start with something like:
tell application "Finder"
-- identify the files:
set theFiles to (every file of (path to desktop))
-- move them to some other location:
move theFiles to folder "blah" of (path to home folder)
end tell
Once you have this you can refine/filter the list in whatever way you like. For example if you want files that begin with the letter 'a':
set theFiles to (every file of (path to desktop) whose name begins with "a")
Or maybe you want files that are jpeg's:
set theFiles to (every file of (path to desktop) whose name extension is "jpg")
Or any number of other variations you like.
codyfromthe wrote:
So how would you do this in applescript?
Did you read the topic I linked? It posts several examples of lines you could use in an Applescript, including shell scripting inside Applescript to make the process much faster in handling large numbers of files. All you need do is copy the desired text to an Applescript Editor window, edit the criteria to meet your exact needs (which are not clear from your post), then save the script.
By the way, did your second question, "So how would you do this in applescript?" solve your first question? 😉
Thanks this helps a lot.
How to move documents due to name in AppleScript edit