Duplicate selection not working

Hi,
here is a sample of my script :
tell application "Finder"
activate
with timeout of 1000 seconds
try
select (every file of the folder DossierArchiveAsura whose name < DateParutionPlusUN and creation date < LaDateFin and creation date > LaDateDebut)
if selection is not {} then
duplicate selection to the folder DossierDateParution
--delete selection
else
activate
display dialog "Aucun fichier à copier." buttons "Ok" default button 1 giving up after 1
end if
select (every file of the folder DossierArchiveAsura whose name > "12_32" and creation date < LaDateFin and creation date > LaDateDebut)
if selection is not {} then
duplicate selection to the folder DossierDateParution
--delete selection
else
activate
display dialog "Aucun fichier à copier." buttons "Ok" default button 1 giving up after 1
end if
on error
display dialog "erreur !"
end try
end timeout
end tell
and the result :
select every file of folder "Controles asura:Archives_Asura:" whose name > "12_32" and creation date < date "samedi 14 octobre 2006 11:22:11" and creation date > date "vendredi 6 octobre 2006 23:22:09"
{document file "3661 ACTUA NB.eps" of folder "Archives_Asura" of disk "Controles asura", document file "3661 ACTUA Q.eps" of folder "Archives_Asura" of disk "Controles asura", document file "express-558.eps" of folder "Archives_Asura" of disk "Controles asura", document file "MBA PAGE1" of folder "Archives_Asura" of disk "Controles asura", document file "MBA PAGE5" of folder "Archives_Asura" of disk "Controles asura"}
get selection
activate
display dialog "Aucun fichier à copier." buttons "Ok" default button 1 giving up after 1
{button returned:"", gave up:true}
If I run the script later it works !!!!! Or something else is duplicated, like the content of all the volume !!!
Oh, I forgot to tell that the script is composed of several part of the same code (of course with different source path) if it can help ?
Thanks a lot for your precious help !
Regards,
Didier.

Hi Didier,
This doesn't look right:
name < DateParutionPlusUN
When you get the name of a file, it returns a string. You probably don't want to do that. If the name is a date string you probably want to coerce it to date first. That's probably why the script is duplicating the whole directory's items. What kind of value is DateParutionPlusUN?
Also, you don't really need to select the items and then duplicate the selection. You can just do something like this:
tell app "Finder"
duplicate (every file of the folder DossierArchiveAsura whose name < DateParutionPlusUN and creation date < LaDateFin and creation date > LaDateDebut) to folder DossierDateParution
end tell
If you wanted to delete the selection later, then it might be better to use a list:
tell app "Finder
set fileList to (every file of the folder DossierArchiveAsura whose name < DateParutionPlusUN and creation date < LaDateFin and creation date > LaDateDebut)
duplicate fileList to folder DossierDateParution
delete fileList
end tell
Edited: Also, what form is the file name in? What kind of date? You might be able to coerce DateParutionPlusUN to short date. It's better if in the form yymmdd. For instance:
"2006/02/01" < "
would be true.
gl,

Similar Messages

  • Photoshop CC. Colour selection not working when using alt and brush.

    Hi, Photoshop CC. Windows 8.1 64 bit. Colour selection not working when using alt and brush. I have tried rebooting and other things like closing swatch panel etc.
    The alt key is otherwise OK.  It's not the recent upgrade from Win 8 to 8.1 (5 days ago) because the colour selection facility was working yesterday. Any ideas.

    I'd say things sound desperate enough to try resetting Preferences
    Reset Preferences
    Windows — Hold down Shift Ctrl Alt immediately after starting Photoshop
    Mac — Hold down Shift Cmd Opt immediately after starting Photoshop
    If that fails, we need to know your operating system?
    Do you have a full CC subscription, or by apps do you mean Photoshop, Bridge and Lightroom?
    Another other information that might pertain ?

  • "Do not import duplicates" is not working

    The "Do not import duplicates" box is checked for all imports but is not working.  This is both for my Nikon DSLR, my Canon S-95 and my iPhone. This was happening with both Snow Leapord and Lion as operating system.  I have been using Aperture since the first release and only in the last few months has this been an issue.  Any thoughts?

    There's a known (and old) bug when duplicate identification fails on photos
    that have been imported from another catalog.
    Sent from phone.

  • Auto Select not working in Photoshop CS6--Why?

    I'm experiencing the auto-select in Photoshop CS6 not working when it is checked and I click on different layers. It worked fine in 5.5, but I am now using PS CS6 cloud and it works only sporadically. Any reason why?
    Thanks in advance!
    -Jane

    Moving this discussion to photoshop Forum discussion.

  • Restriction in Rows Selection not working

    Hello,
    I  have a requrement where i need to restrict the material based on the date
    output is
    Sno Material                                       date           quantity
    1      Material > 90 days                  5/7/2012        20
            material within 90 days          12/31/2011      5
                                                            1/2/2012        10
    like this
    Material > 90 days is material exist 90 days from current system date Ex. for Feb 7,2012 ./ the range is may 7 ,2012
    material within 90 days is material  +  or - 90 days.. ex, for Feb 7,2012 .. the range is Dec 7,2011 to May 7,2012
    I created a new selection in Rows for material and restricted based on 0DAT variable with offset.
    its not working.
    Request you to help on this
    Thanks
    Bala

    Hi, Malkit.
       I am not quite clear with this "Earlier it was working fine but some how it stopped although custom OVS is working fine when i remove the restricted filed, all the values come properly".
    Can you please explain what happened more clearly?
    Have you tried executing your QueryByElements with projectID in PDI?
    Regards,
    Fred

  • Option-drag selection not working in CS6 layer panel

    Thought I'd force myself to use CS6 on a new project. I want to select multiple objects using "Option-drag", in the Layer Panel, but it doesn't work as it does in CS5.
    Is there a different shortcut for selecting multiple contiguous objects using the Layer Panel, in CS6? Of course, I mean "Select" not "highlight".
    Thanks.

    Ok so it has been omitted in CS 6 and I think the reason is is because of the change to the Layers panel function.
    That is because you can now rename and object directky with the Layers Panel rather than use the Layer Options.
    Whether this wa intentional or by accident I do not know but that is why I think it has been changed.
    I would make a feature request to either return it to Option Drag or Or Option Click to select a contigous selection of objects.
    I notice that many people use names for their paths on even modest ai files so I would think being able to name the objects and layers are a really important feature but so is the feature you referring to though I think Click-Option Click would be even better on rellly large complex Illustrations.

  • Field selection not working in Calculate tab

    Hi, I'm trying to use a simple "Sum" calculation and it is suddenly not working.  I can't select individual fields.  "Select All" will put a check mark in every field.  Trying to pick the four fields I need does not.  I used this feature successfully in the past but cannot understand why it won't work now.  Please help!  Thanks in advance.

    Use the space-bar or click a bit off to the center of the check-box to toggle it. It's a known bug of Acrobat (I answered this same question like 3 times in the last two days alone...).

  • Code at Infoset SQ02 - Start of Selection - not working

    I have a code at SQ02 infoset START-OF-SELECTION:
    select bukrs
      into table i_bukrs
      from t001
      where bukrs in ('SP$00007').
    if sy-subrc = 0.
    endif.
    where SP$00007 is a select-option at the query selection screen.
    This coding is not working. It is always returning sy-subrc 4. How do I acces a select option form the query start of selection?
    Where I am doing wrong? I have got the 'SP$00007' from the generated code of query.
    If I try like this it gives me a syntax error:
    where bukrs in SP$00007.
    Any idea what I am doing wrong?

    The Solution:
    DATA cond_syntax TYPE string.
    CONCATENATE 'BUKRS' 'IN SP$00007'
                INTO cond_syntax SEPARATED BY space.
    SELECT bukrs
      INTO TABLE i_bukrs
      FROM t001
      WHERE (cond_syntax).
    IF sy-subrc = 0.
      LOOP AT i_bukrs INTO wa_bukrs.
        AUTHORITY-CHECK OBJECT 'J_B_BUKRS'
                 ID 'BUKRS' FIELD wa_bukrs-bukrs.
        IF sy-subrc <> 0.
          MESSAGE s000(z_zzz_ca_messages)
          WITH
          'You do not have authorization to view Company Code '
           wa_bukrs-bukrs
           ' data.'.
          LEAVE LIST-PROCESSING.
        ENDIF.
      ENDLOOP.
    ENDIF.
    If there is a better way please let me know?

  • Duplicate movieclip not working!!

    i have create a function for duplicate movieclip but when i
    call for the function it not working. Is there anyone who can help
    me to trace wats going on wif my script? i have been trying to
    figure out but still cant find out wat went wrong.
    Below is my code:

    thanks kglad! finally got the duplicate work!!!

  • At line selection not working

    HI,
    at line selection is not working in my program after i used set pf-status. please help.
    regards,
    ravi.

    Hi Ravi,                                                       
    double click on ur set pf status 'xxx'.
    this will give u a user interface screen.
    open the function keys button.
    u '' find standard tool bar ,,
    Recommended function key settings     
    freely assigned function keys.
    in recommended function key settings just type this for f2
    Recommended function key settings    
    F2              PICK         Choose                                                                               
    see that u have the values like this for F2.       
    save , activate ,
    do this ..
    regards,
    Vijay.
    Message was edited by: Vijay

  • Auto select not working ?

    I've been struggling to understand copy and paste in version 5 and I am either not understanding it correctly, or it's not working as it is supposed to. If I auto select track 2 only, then copy and paste a clip from track 1, it will still paste to track 1. Am I doing something wrong?

    Turning autoselect off and then on a second time worked. It's nice to finally be able to do this, but is this supposed to be a sensible or intuitive way to copy and paste? I much preferred FCP3's way. Thanks for the help.

  • Outlook 2003 Recipent Selection Not working on Word created emails

    I have a user who when using word as his default editor, can see previously emails contacts but cannot select them. Selecting them just causes the select box to dissapear leaving the characters in the textbox.
    He's set his default editor as outlook but the problem there is when he's typing long emails in a rich text format only the initial draft is sent rather than the entire email. I've read that changing the editor to word is a fix but with recipent selector
    not working his outlook is pretty un-usable.
    Anyone seen this before? He's running on windows 8.1 with office 2003.

    Hello,
    What's the difference between the permissions?
    Can the users receive emails from OWA?
    In addition, please make sure your Outlook 2007 has installed the latest update. And try to use
    outlook/cleanips and check if it helps. See:
    http://support.microsoft.com/kb/968773/en-us
    Best Regards,
    Steve Fan
    TechNet Community Support

  • "merge duplicate contacts" - not working

    I have roughly 3600 contacts, many of which are duplicate names. I ran 'merge duplicate contacts' and Address Book came back and advised there were 1500 duplicates (which seemed high but, hey). I said, yes, 'merge' and it went off for two to three minutes and finished. There was no change in the number of contacts! All dups were still there.
    So I ran it again and Address Book found no duplicates, even though there are still as many as there were originally.
    Mystified.
    Dave

    Rocking wrote:
    PLease help me in resolving this problem
    Hi,
    I'm sure that people will be happy to help you if you would explain better your problem.
    You simply wrote "is not working". Don't you think it is a bit too generic?
    Do you get an Oracle error, data are not updated as expected?
    We don't know what your problem is. Sorry.
    Please follow Paul advice and check the FAQ which is explaining how to post a question.
    A well written question will definitely get a good answer.
    Regards.
    Alberto

  • Import duplicate detection not working?

    I've done a lot of searching and can't seem to find the answer. All our photos live on my laptop. My wife's laptop has some of our photos but also a lot of ones for work. I'm trying to give her the complete set of all our photos.
    I did some tests and found the "Import duplicate photo?" dialog box very helpful. So I went through and compared our libraries but there were thousands to compare. So I decided to make a folder on her desktop of all our photos from my computer. My theory was I could simply import all the photos and iPhoto would detect the duplicates and I could choose to not import them. It doesn't seem to work, I did a couple tests and all the duplicates got through.
    I upgraded her iPhoto version to iPhoto '08 (7.1.2) just before doing this process since her old version didn't support the dupe detection. Interestingly when I import a photo in her current version it shows up as the filename without the extension but the existing photos all have the extension. I think this is why they aren't being seen as dupes.
    Any ideas how to remedy this? My fallback will be to use Duplicate Annihilator but that will require copying in everything (thousands of photos) and then sifting. Seems scary and unnecessary.

    iPhoto doesn't display the extension in the Info window at the lower left hand corner or in the Title field. If you use the Photos->Show Photo Info menu option you'll see the full file name. Also do you have the Finder set to display the extensions?
    *Do not import a full library into another library with iPhoto. That imports the thumbnail, modified and original files as new files which is not what you want.*
    What you can do is to use iPhoto Library Manager to merge the two libraries into a new, third library and use its duplication elimination features to cull out the duplicates. If the new library isn't what you want the original two libraries will be untouched.
    Another possibility is to copy the Originals folder from your wife's library to the desktop and import that folder and subfolders into your library. I found that importing from folders on the HD do cull out duplicates successfully. Then you can copy your library to her laptop.
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier versions) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger or later), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. There are versions that are compatible with iPhoto 5, 6, 7 and 8 libraries and Tiger and Leopard. Just put the application in the Dock and click on it whenever you want to backup the dB file. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    NOTE: The new rebuild option in iPhoto 09 (v. 8.0.2), Rebuild the iPhoto Library Database from automatic backup" makes this tip obsolete.

  • Keyboard shortcuts for text selection not working in Flash CC

    In the new Code Editor in Flash CC running on Mac OS X, most standard Keyboard Shortcuts for traversing through the text work as expected (as the Operating System works globally) but there is one that doesn't and it's I think the most important one.
    Hitting "OPTION + SHIFT + [right or left arrow keys]" to select words doesn't work. Hitting "OPTION + [right or left arrow keys]" works as expected, moving the cursor to the next word or break point, but adding shift doesn't do the selection.
    I don't understand why this changed since it's a basic OS global shortcuts, and every other program behaves the way it should. Flash CS6 running on the same system behaves fine, but Flash CC doesn't. If you have ever written code, you know that any second that a programmers hand doesn't have to leave the keyboard to search for the mouse is invaluable, and this has forced me to stop using Flash CC and use Flash CS6 to edit my Action Script classes becuase it's unusable otherwise.
    These shortcuts are also not listed in the keyboard shortcuts for the program, so I can't change the default behavior. Does anybody know if there's a way to set it back to the way it was before, or just disable special text shortcuts so that selecting text behaves like any other application in the operating system?
    System Configuration:
    Flash CC
    Mac OSX 10.8.5

    Amy~ Yep the lasso tool was what I verified with another user. 'L' seems to be bound indefinitely to loop through different types of lasso tools and it was annoying them because they just wanted L to be the regular freehand lasso. I removed 'L' from being an option on the polygon lasso and even set it explicitly to SHIFT+L as well as set the lasso tool to a completely different keyboard combo. 'L' still cycled through lassos haha. It needs some fixes.
    fertolg~ At least you have a workaround for now. I'd go nuts if I couldn't use keyboard text selection writing code, oy! You're welcome and if you're all set please mark correct so we can filter unanswered. Good luck!

Maybe you are looking for