RE: New to OS 10 help Please
RE: New to OS 10 help Please
- Subject: RE: New to OS 10 help Please
- From: "Easthope, John R" <email@hidden>
- Date: Thu, 3 Apr 2003 10:55:52 -0700
In our case all the files need to be kept.
Here is our scenario:
* We have a number of identical digital cameras that use a similar default
naming convention - i.e., img006, img007, etc.
* We also have a ASIP share that acts as central repository for these
images. (With guest access)
* When the users move their files into this shared folder we try to get them
to create new folders so that similar file names will not be overwritten but
this doesn't always happen. The result is that some of the picture files
with similar names get overwritten.
To solve this issue we forced the creation of a new folder for each user's
download but now we have a folder full of many folders. We would like to
take advantage of the script to consolidate the folders but when we use it
we get to many duplication errors and ignoring the errors would fool the
users into thinking that it worked and then discarding the subfolders which
may still contain unmoved images.
So what we are hoping for is an additional routine for the script that would
append file names somehow when a duplicate is encountered. Any help would be
appreciated.
Thanks
_________________________________________
John Easthope
School Technology Support Analyst
Calgary Board of Education
Help Desk: 294-8111 Fax: 294-8689
Email: email@hidden
_________________________________________
>
----------
>
From: Andrew Oliver
>
Sent: Wednesday, April 2, 2003 10:29 AM
>
To: Easthope, John R; email@hidden
>
Subject: Re: New to OS 10 help Please
>
>
The question really is what do you want to do with items that have the
>
same
>
name?
>
>
Checking the Finder's dictionary, you can see that the 'move' command
>
accepts an optional 'replacing' flag. If set (by appending 'replacing yes'
>
at the end of the move command), the Finder will replace files with
>
duplicate names.
>
>
If you don't want that, you can do whatever you want with the file by
>
enclosing the move statement in a try/on error/end try block. Maybe you
>
want to warn the user:
>
>
try
>
move aFile to folder destFolder
>
on error -- oops, couldn't move the file
>
display dialog ("Couldn't move " & name of aFile as string) buttons
>
{"OK"}
>
end try
>
>
Or maybe you don't care - in which case eliminate the line that displays a
>
dialog.
>
>
The options are almost limitless.
>
>
Andrew
>
:)
>
>
On 4/2/03 7:58 AM, "Easthope, John R" <email@hidden> wrote:
>
>
> What do you do about files that may have the same name?
>
>
>
> _________________________________________
>
>
>
> John Easthope
>
> School Technology Support Analyst
>
> Calgary Board of Education
>
> Help Desk: 294-8111 Fax: 294-8689
>
> Email: email@hidden
>
> _________________________________________
>
>
>
>
>
>
>
>> ----------
>
>> From: Andrew Oliver
>
>> Sent: Tuesday, April 1, 2003 4:32 PM
>
>> To: email@hidden; email@hidden
>
>> Subject: Re: New to OS 10 help Please
>
>>
>
>> The simplest way is not to select any items at all
>
>>
>
>> Since it looks like you're trying to collapse multiple subfolders into
>
one
>
>> folder, a simple recursive script will do the job much better:
>
>>
>
>> property destFolder : "Macintosh HD:MOVED" -- or wherever the
>
destination
>
>> folder is
>
>>
>
>> tell application "Finder"
>
>> set sourceFolder to folder "MOVE ME" -- of disk "blah", etc.
>
>> my moveFilesFrom(sourceFolder)
>
>> end tell
>
>>
>
>> on moveFilesFrom(thisFolder)
>
>> tell application "Finder"
>
>> set filesToMove to every file of thisFolder
>
>> repeat with aFIle in filesToMove
>
>> move aFIle to folder destFolder
>
>> end repeat
>
>> set subFolders to (every folder of thisFolder)
>
>> repeat with aFolder in subFolders
>
>> my moveFilesFrom(aFolder)
>
>> end repeat
>
>> end tell
>
>> end moveFilesFrom
>
>>
>
>> The idea here is that the script tells the finder to move 'every file'
>
in
>
>> the folder. It then gets a list of every folder inside the current
>
folder
>
>> and calls itself. This will repeat through all subfolders until all
>
files
>
>> are moved.
>
>>
>
>> It doesn't rely on any kind of object selection in the Finder, so it
>
can
>
>> run
>
>> quietly in the background while the user is performing other tasks -
>
>> something you can't do it you're trying to move the selected item in
>
the
>
>> Finder.
>
>>
>
>> On 4/1/03 11:53 AM, "email@hidden" <email@hidden> wrote:
>
>>
>
>>> Having just migrated to OS X I have a script (from OS9 ) that I use a
>
>> lot and
>
>>> can't figure out how to get it to work in OS X. I am trying to pull
>
all
>
>> the
>
>>> files out of a large number of folders and put them into one folder. I
>
>>> understand finder is different in 10 but can't figure out how to just
>
>> select
>
>>> the files and not the folders.... I get "Finder got an error: Can't
>
set
>
>>> expanded of selection to true" from the following script....
>
>>> tell application "Finder"
>
>>> with timeout of 300 seconds
>
>>> activate
>
>>> select {every folder of folder "MOVE ME"}
>
>>> set expanded of selection to true
>
>>> select {every item of every folder of folder "MOVE ME"}
>
>>> move selection to folder "MOVED"
>
>>> end timeout
>
>>> end tell
>
>>>
>
>>> Thanks for any help in this matter.
>
>>> Mark
>
>>> email@hidden
>
>>> _______________________________________________
>
>>> applescript-users mailing list | email@hidden
>
>>> Help/Unsubscribe/Archives:
>
>>> http://www.lists.apple.com/mailman/listinfo/applescript-users
>
>>> Do not post admin requests to the list. They will be ignored.
>
>> _______________________________________________
>
>> applescript-users mailing list | email@hidden
>
>> Help/Unsubscribe/Archives:
>
>> http://www.lists.apple.com/mailman/listinfo/applescript-users
>
>> Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.