Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > In need of an Applescript that moves files

In need of an Applescript that moves files
Thread Tools
Senior User
Join Date: Jul 2001
Status: Offline
Reply With Quote
Jun 7, 2004, 07:44 PM
 
Hi, I am in need of an apple script that moves file types into a folder each of their own. Like .jpg and .xml and so on. But I need to be able to edit it as I have all sorts of uncommon file types to. Can some one help me ?
     
loren s  (op)
Senior User
Join Date: Jul 2001
Status: Offline
Reply With Quote
Jun 8, 2004, 03:39 PM
 
Originally posted by loren s:
Hi, I am in need of an apple script that moves file types into a folder each of their own. Like .jpg and .xml and so on. But I need to be able to edit it as I have all sorts of uncommon file types to. Can some one help me ?
Does no one know of a script ? Or at least a site that has a daily list of new scripts ?
     
Posting Junkie
Join Date: Nov 2001
Location: Retired.
Status: Offline
Reply With Quote
Jun 8, 2004, 03:44 PM
 
Originally posted by loren s:
Or at least a site that has a daily list of new scripts ?
http://macscripter.net/
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Jun 8, 2004, 07:41 PM
 
     
Mac Enthusiast
Join Date: Jan 1999
Location: Marietta, GA, USA
Status: Offline
Reply With Quote
Jun 9, 2004, 02:08 PM
 
I have a simple script which does exactly this. I'll post it tonight when I get home...
Scott Genevish
scott AT genevish DOT org
     
loren s  (op)
Senior User
Join Date: Jul 2001
Status: Offline
Reply With Quote
Jun 9, 2004, 07:13 PM
 
Originally posted by Diggory Laycock:
you could alter my script which does something similar:

http://monkeyfood.com/software/LibrarySorter/

http://monkeyfood.com/software/Libra...orter.scpt.sit
I tried this, but it is being futzzy with me. I will try again,

I "have" seen an app that does this, but only for the desktop not a folder that it lives in, and it could not be edited as it was just a closed application script, but it had buttons for a bunch of formats but a few I needed were not there.

genevish: Please if you can I would love to get your script, as I am in dire need of a tool to organize my countless files.
     
Mac Enthusiast
Join Date: Jan 1999
Location: Marietta, GA, USA
Status: Offline
Reply With Quote
Jun 10, 2004, 06:40 PM
 
Oops, I forgot. Here you go:
Code:
on adding folder items to this_folder after receiving these_items repeat with i from 1 to number of items in these_items set this_item to item i of these_items set this_item_info to info for this_item set this_extension to name extension of this_item_info if (this_extension is "jpg") then tell application "Finder" move this_item to folder "Pics" of this_folder end tell end if if (this_extension is "mov") then tell application "Finder" move this_item to folder "Video" of this_folder end tell end if if (this_extension is "wmv") then tell application "Finder" move this_item to folder "Video" of this_folder end tell end if if (this_extension is "mpeg") then tell application "Finder" move this_item to folder "Video" of this_folder end tell end if if (this_extension is "avi") then tell application "Finder" move this_item to folder "Video" of this_folder end tell end if if (this_extension is "mpg") then tell application "Finder" move this_item to folder "Video" of this_folder end tell end if end repeat end adding folder items to
Scott Genevish
scott AT genevish DOT org
     
loren s  (op)
Senior User
Join Date: Jul 2001
Status: Offline
Reply With Quote
Jun 10, 2004, 10:39 PM
 
Originally posted by genevish:
Oops, I forgot. Here you go:
Code:
on adding folder items to this_folder after receiving these_items repeat with i from 1 to number of items in these_items set this_item to item i of these_items set this_item_info to info for this_item set this_extension to name extension of this_item_info if (this_extension is "jpg") then tell application "Finder" move this_item to folder "Pics" of this_folder end tell end if if (this_extension is "mov") then tell application "Finder" move this_item to folder "Video" of this_folder end tell end if if (this_extension is "wmv") then tell application "Finder" move this_item to folder "Video" of this_folder end tell end if if (this_extension is "mpeg") then tell application "Finder" move this_item to folder "Video" of this_folder end tell end if if (this_extension is "avi") then tell application "Finder" move this_item to folder "Video" of this_folder end tell end if if (this_extension is "mpg") then tell application "Finder" move this_item to folder "Video" of this_folder end tell end if end repeat end adding folder items to
I hate to sound stupid, but it does not work for me I tried saveing it as an app I ran it as a script and I saved it to the same folder as the files but no go...

,
     
Mac Enthusiast
Join Date: Jan 1999
Location: Marietta, GA, USA
Status: Offline
Reply With Quote
Jun 11, 2004, 08:24 PM
 
Control-click on the folder you want to attach it to, select "Enable Folder Actions" (if they're not enabled already), control-click again and select Attach a Folder Action. Select the script...
Scott Genevish
scott AT genevish DOT org
     
loren s  (op)
Senior User
Join Date: Jul 2001
Status: Offline
Reply With Quote
Jun 18, 2004, 07:27 PM
 
Neat, is there anyway to make it a run one time only thing ? Like just when I want to press the run button ?

Well thank you anyway.
     
Mac Enthusiast
Join Date: Jan 1999
Location: Marietta, GA, USA
Status: Offline
Reply With Quote
Jun 21, 2004, 08:49 PM
 
Just save it as an application in Script Editor. Then run it whenever you want...
Scott Genevish
scott AT genevish DOT org
     
Professional Poster
Join Date: Nov 2003
Location: Hamburg
Status: Offline
Reply With Quote
Jun 22, 2004, 06:45 AM
 
Since this topic is exactly what I also need I am not going to start a new thread...but post my request here!

Can anybody tell me how to do this:

I have several hundred folders containing several thousand files that need to be sorted.
First I want to move all files into one folder (I think I know how to do this with the terminal) but then I want to sort all files by their names.
Files look like this:
aaaaaa1
aaaaaa2
aaaaaa3
...
bbbbbb1
bbbbbb2
bbbbbb3
...
aabb1
aabb2
aabb3
...
I am not sure but I think they can all be identified by the first 4-5 digits and 1,2,3,4,5... should be sorted into folders called aaaa, bbbb, aabb!

This should be easy but since I have never done any scripting I need some help!

Thanks to anybody!
(Last edited by badidea; Jun 22, 2004 at 07:01 AM. )
     
Mac Enthusiast
Join Date: Jan 1999
Location: Marietta, GA, USA
Status: Offline
Reply With Quote
Jun 22, 2004, 12:27 PM
 
So you want everything that starts with 'aaaaa' in one folder, and everything that starts with 'aabb' in another folder, etc?
Scott Genevish
scott AT genevish DOT org
     
Professional Poster
Join Date: Nov 2003
Location: Hamburg
Status: Offline
Reply With Quote
Jun 23, 2004, 04:59 AM
 
Originally posted by genevish:
So you want everything that starts with 'aaaaa' in one folder, and everything that starts with 'aabb' in another folder, etc?
Yes!

This script has to detect that there are for example 50 aaaaaa* files, then create one folder called 'aaaaaa' and move all aaaaaa* files into that folder...
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 11:22 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2