Mac Help Forums


Reply
Thread Tools Display Modes

File sorting replacing problem.

 
Member
Join Date: Jul 2010
Posts: 11
 
      2nd August 2010
I am have made a folder action. It works in for the most part but where I am having a problem is it will not replace the file once it aready exists.

What I am tring to do is but files in alphabetitcal order based on the first letter of the file. and but it in the subfolder.

also if anyone can stream line this any better I am all ears. I have tried different replace commands I could come up with but it did not work.

Any help anyone could give I would be thankful

This is the Code that work with out the replacing function

tell application "System Events"
set these_files to every file of folder "Volumes:Member Pics"
repeat with i from 1 to number of items in the these_files
set this_item to item i of the these_files
set this_info to info for this_item
if visible of this_info is true then
set file_name to name of the this_item
set the first_char to (character 1 of the file_name) as string
beep 1
display dialog first_char buttons {"OK"} default button 1
if first_char is "a" then
move this_item to ":Volumes:Member Pics:a"
else if first_char is "b" then
move this_item to ":Volumes:Member Pics:b"
else if first_char is "c" then
move this_item to ":Volumes:Member Pics:c"
else if first_char is "d" then
move this_item to ":Volumes:Member Pics:d"
else if first_char is "e" then
move this_item to ":Volumes:Member Pics:e"
else if first_char is "f" then
move this_item to ":Volumes:Member Pics:f"
else if first_char is "g" then
move this_item to ":Volumes:Member Pics:g"
else if first_char is "h" then
move this_item to ":Volumes:Member Pics:h"
else if first_char is "i" then
move this_item to ":Volumes:Member Pics:i"
else if first_char is "j" then
move this_item to ":Volumes:Member Pics:j"
else if first_char is "k" then
move this_item to ":Volumes:Member Pics:k"
else if first_char is "l" then
move this_item to ":Volumes:Member Pics:l"
else if first_char is "m" then
move this_item to ":Volumes:Member Pics:m"
else if first_char is "n" then
move this_item to ":Volumes:Member Pics:n"
else if first_char is "o" then
move this_item to ":Volumes:Member Pics"
else if first_char is "p" then
move this_item to ":Volumes:Member Pics"
else if first_char is "q" then
move this_item to ":Volumes:Member Pics:q"
else if first_char is "r" then
move this_item to ":Volumes:Member Pics:r"
else if first_char is "s" then
move this_item to ":Volumes:Member Pics:s"
else if first_char is "t" then
move this_item to ":Volumes:Member Pics:t"
else if first_char is "u" then
move this_item to ":Volumes:Member Pics:u"
else if first_char is "v" then
move this_item to ":Volumes:Member Pics:v"
else if first_char is "w" then
move this_item to ":Volumes:Member Pics:w"
else if first_char is "x" then
move this_item to ":Volumes:Member Pics:x"
else if first_char is "y" then
move this_item to ":Volumes:Member Pics:y"
else if first_char is "z" then
move this_item to ":Volumes:Member Pics:z"
end if
end if
end repeat
end tell
.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting 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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iTunes Sorting John Varela Apps 10 23rd December 2011 05:13 AM
sorting... -a- iPod 1 27th June 2008 04:05 AM
Replacing Power Supply--fan cable problem Captain Nemo Hardware 0 1st June 2008 07:35 PM
File sorting replacing problem LightGear AppleScript 5 17th November 2005 01:30 PM
Replacing Palm Desktop User data file Peter Ceresole UK Macs 2 26th April 2005 06:46 AM


All times are GMT +1. The time now is 10:06 PM.
Mac-Help.com is an independent website and is not affiliated with Apple Inc.


Welcome!
Welcome to the Mac Help Forums
 


Latest Threads
2009 Macbook Pro Issues
Art4261 (8 Hours Ago, 01:37 PM)

imac won't start
jmkwills (16 Hours Ago, 05:15 AM)

Safari not loading certain sites
seanv (20 Hours Ago, 01:59 AM)

Repair tool for iphoto
dollop46 (1 Day Ago, 08:25 PM)

Suitable home use bar code reader
Brian Forder (1 Day Ago, 10:05 AM)

 


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51