"move" command doesn't work in case of files on network

I setup a theWatchFolder fold on network as Watch Folder. This works like when the folder on network gets a file, I'm notified via email and the file should move from watch folder (which is on network) to theDestinationFolder (which is also on another network). I used "move" command for that but it copies the files from the theWatchFolder to theDestinationFolder but doesn't move. And there, script shows error "An item with the same name already exists in this location."
global theWatchedFolder
global DestinationFolder
set theWatchedFolder to choose folder
set theDestinationFolder to choose folder
on idle
    tell application "Finder"
        set theDetectedItems to every item of theWatchedFolder
        repeat with aDetectedItem in theDetectedItems
            move aDetectedItem to the theDestinationFolder
        end repeat
    end tell
    if theDetectedItems ≠ {} then
        activate
        display dialog "Files for cutout were detected and moved to your " & theDestinationFolder
        tell application "Microsoft Outlook"
            set m to make new outgoing message with properties {subject:"Files For Cutout Received", content:"Hello there:
            Files for cutout received"}
            tell m
                make new recipient with properties {email address:{name:"KK", address:"[email protected]"}}
            end tell
            send m
        end tell
    end if
    return 1
end idle

Hi H:
Thanks for your help.
I opted the Option 1 from your script. When a file arrives in Watch Folder, the script still copies to the destination folder (instead of move) and sends email successfully, and this task repeats continuously. The script is as follows:
global theWatchedFolder
global theDestinationFolder
set theWatchedFolder to choose folder
set theDestinationFolder to choose folder
on idle
          tell application "Finder"
                    set theDetectedItems to every item of theWatchedFolder
                    repeat with aDetectedItem in theDetectedItems
                              set a to aDetectedItem as alias
                              set b to (move a to theDestinationFolder with replacing) as alias
                              if a ≠ b then
                                        tell current application
                                                  do shell script "rm -rf " & POSIX path of theWatchedFolder
                                        end tell
                              end if
                    end repeat
          end tell
          if theDetectedItems ≠ {} then
  activate
                    display dialog "Files for cutout were detected and moved to => " & theDestinationFolder
                    tell application "Microsoft Outlook"
                              set m to make new outgoing message with properties {subject:"Files For Cutout Received", content:"Hello there: Files for cutout received"}
                              tell m
  make new recipient with properties {email address:{name:"KK", address:"[email protected]"}}
                              end tell
  --open m
                              send m
                    end tell
          end if
          return 1
end idle

Similar Messages

  • I have a few desktop icons that won't allow me to move them to trash or relocate them on desktop.  A PDF, a DOCX and a PART.  Not locked under get info or get info command doesn't work. Suggestions?

    I have a few desktop icons that won't allow me to move them to trash or relocate them on desktop.  A PDF, a DOCX and a PART.  Not locked under get info or get info command doesn't work. Suggestions?

    This any help?
    http://support.apple.com/kb/HT1526

  • [Photoshop CC 2014] Click&hold-move-release doesn't work when adding adjustment layer from the layer panel

    When selecting a menu item I used to click the left mouse button and hold it down, move the pointer to the desired menu item and release the mouse button. Everything works fine in the mine menu, but there's a problem when adding new adjustment layer from the layer panel: when I release the button nothing happens, I have to press the button again. In previous PS version it worked fine. How can I fix this?

    I don't think that is user fixable, meaning you'll have to wait till adobe fixes it with an update.
    Photoshop cc 2014
    windows does not work
    mac does work
    Did you already post over here:
    [Photoshop CC 2014] Click&hold-move-release doesn't work when adding adjustment layer from the layer panel

  • Visually handicap, needs to increase font size in logic pro, Command  doesn't work

    Hi,
         I'm visually handicapped, and new to logic-pro.  I'm having a miserable time reading the internal logic-pro fonts.  Command + doesn't work, and I can't find any preferrence or settings options that affect the default font sizes, any ideas?

    Unfortunately you cannot change the font size of the main fonts in Logic...
    However, there are a couple of other settings you may not be aware of...
    1) Under Logic Pro's preferences... go to Display
    Now you can change the size of the playhead and Local Windows under the General Tab
    You can increase the size of the Logic plugin windows/fonts sizes under the Mixer Tab (I have mine set to 200%)
    Note: This setting does not apply to 3rd party plugins.. only Logic's own plugins...
    Under the Piano Roll tab you can change the size of Bar/Beats/Division Lines...
    2) Using the screen zoom command... Hold down control and scroll on your mouse... will zoom in the screen...
    Note: as you are using Mountain Lion there is also a new setting under System Preferences/Accessability
    Choose Zoom on the left hand side
    Now choose Zoom Style/Picture in Picture and instead of a full screen zoom it provides you with a magnifying glass of sorts to just magnify the area arund your mouse pointer. I find this setting very useful....
    Hope this helps...

  • HT1338 Safari Hide command doesn't work

    Now my Safari 6.0 "Hide Safari" command doesn't work (whether clicking the command-H or going up under the Safari menu and down to the Hide Safari command.
    Any suggestions anyone? I am about one more issue away from abandoning Safari altogether and just using Chrome and Firefox.

    I've made a number of iWeb websites. I notice that I can't "Command +" the text larger or smaller. Is this a function of an iWeb site .. or is there something I'm missing?
    What browser are you talking about? If Safari, is it the same with the other major browsers (Firefox and Opera)? Could you provide the url of an example?

  • Bash command doesn't work after update

    I just ran pacman -Syu as normal, but some got many errors like below:
    ( 3/11) upgrading binutils
    error: command failed to execute correctly
    and every package except kernel-headers got a error message like that. and then i found most of my bash command doesn't work any more, just like ls and vim. However, some others like pwd and cd still work correctly.
    Any one any ideal?
    Last edited by ranjiao (2009-11-12 13:26:01)

    ranjiao wrote:I removed /lib64 and make a soft link from /lib64 to /lib, as Matlab09 requires a /lib64 containing crt libs.
    is this the cause?
    Yes.
    I've done that before and got into the same problem when updating glibc, the lesson here, don't mess with the default directory structure.

  • Unhide library command doesn't work

    Unhide library command doesn't work in terminal

    Open the Terminal application in your Utilities and paste the following at the prompt:
    sudo chflags nohidden ~/Library
    Press RETURN. Enter your admin password when prompted. It will not be echoed.
    The "sudo" may not even be required, but if it is and you don't use it, then you'll get an error message. Just try again using the above command.

  • Safari 6.0 command- doesn't work

    Command+ works fine but command- doesn't work. I'm running 10.7.5

    Just add the following to the file com.apple.WebProcess.sb.
    Please add it below the Basic system paths and above the FIXME: or System and user preferences:
    ;; Plugins
    (subpath "/Library/Internet Plug-Ins")
    (home-subpath "/Library/Internet Plug-Ins")
    And it's fixed!

  • Why setting the download folder ton an external HDD doesn't work? the downloaded files goes to My Documents (Windows)?

    Why setting the download folder ton an external HDD doesn't work? the downloaded files goes to My Documents (Windows)?

    I did what you said and updated FF, now the download goes to the external HDD that I specified, but now FF bugs, it freezes (not responing) :s
    I reinstalled it but it doesn't fix the problem. I don't know what to do :(

  • Fast Forward & Rewind doesn't work for long audio files

    I have loaded several mp3 files into the Pre via USB.  Some are 2+ hours long, some are a few minutes.  Fast forwarding thru the track doesn't work on the long files.  Holding down the fast-forward arrows will cause the audio to stutter in the same place, sometimes go BACKWARDS instead of forwards, and eventually it will go silent.  Pressing Pause, Play, whatever won't bring it back and ytou have to start the audio file over.
    Help, Palm!
    Post relates to: Pre p100eww (Sprint)

    Yea, the fast forward is way lame and pretty much...
    You get the idea.
    mark

  • Find command doesn't work

    The find command F or just Find doesn't work any ideas on fixes? I tried trashing kybrd and finder prefs. This is on a G3 running 9.2
    Thanks

    Hi, Bookalaka -
    If Sherlock, or an alias to it, is not in the Apple Menu Items folder (in System Folder), then the Find function (Command-F) will not work. If that is the case, replace that item - move either Sherlock itself, or place an alias to it, into the Apple Menu Items folder.
    Note - if you use Internet Explorer, and want to be able to use the supplemental toolbar icon for Sherlock, then Sherlock itself must be placed in the Apple Menu Items folder (IE does not recognize an alias to it).
    If for some reason you are missing Sherlock completely, you can replace it fairly easily. Look in the System Folder on any OS 9.1 or later Install CD; you'll find it in the Apple Menu Items folder. Just copy it to your hard drive.

  • Priority class command doesn't work with a certain program

    Hello folks,
    I'm trying to automatize the priority class setting of a program named FreeTrack through a command written in the shortcut. Hence in its "target" I've written this (I'm using Windows 7 x64):
    C:\Windows\System32\cmd.exe /c start /REALTIME /AFFINITY 8 "" "E:\Program Files (x86)\FreeTrack\FreeTrack.exe"
    As you can see I also wanted the affinity mask of the program to be set automatically upon launch, and it works fine. The issue is that the priority class remains unchanged to normal.
    I've tried removing the "affinity" command but it didn't work.
    The priority command does its job on another program (for the attempt I used Firefox).
    Is there any explanation for this anomalous behaviour? And, most importantly, is there a solution (which preferably doesn't involve installing additional programs) ?
    Thank you and regards

    All right, I've found a solution; I'll post it for anyone in need. It's not particularly elegant but still functional.
    First of all I've created a .cmd file in the folder where is located the executable of my interest.
    In it, using notepad, I've written as following:
    start /affinity 8 FreeTrack.exe
    ping 1.1.1.1 -n 1 -w 2000 > nul
    wmic process where name="FreeTrack.exe" CALL setpriority 256
    Note that the /affinity command is optional and not required (however, I needed it). Replace "FreeTrack.exe" with the name of your executable.
    The ping part pings a fake IP once and then waits 2000 milliseconds (set a higher waiting time if this one doesn't work).
    The third line changes the priority for all the processes under the name of "FreeTrack.exe" to, in my case, realtime.
    Priority legend:
    Low: 64 Below Normal: 16384 Normal: 32 Above Normal: 32768 High: 128 Realtime: 256
    Since the command prompt window appears for 2 seconds and I don't like that, I've created a .vbs file in the same folder of the .cmd file and executable. This hides the cmd window.
    I've put the following into the .vbs file (edited with notepad):
    Set WshShell = CreateObject("WScript.Shell" )
    WshShell.Run chr(34) & "FreeTrack.cmd" & Chr(34), 0
    Set WshShell = Nothing
    Replace "FreeTrack.cmd" with your .cmd file name.
    I've then created a shortcut on the desktop to the .vbs file and changed the icon to the one of the executable.
    Surely this solution won't work if the program keeps reverting back its priority while running.

  • Unix Command doesn't work in Tiger

    Hi,
    I've got labs of eMacs that I'm finally upgrading to Tiger. My image seems to work fine, but I'm running into a weird quirk with my "Send Unix" commands via ARD. We're doing NWEA testing and LOVE the unix commands because we can login to machines, turn on TestTaker, login to TestTaker, and select the correct test (math or reading) and the right version of the test.
    The script below works fine on a panther eMac.
    osascript
    tell application "System Events"
    keystroke "1" using command down
    delay 3.0
    keystroke ASCII character 31
    delay 2.0
    keystroke return
    keystroke "n" using command down
    end tell
    On my Tiger machines, the command stops on the:
    "Keystroke ASCII character 31" line (this should arrow down to next test version).
    A report window comes up in ARD with this error message:
    86:104: execution error: System Events got an error: 31 doesn't understand the ASCII character message. (-1708)
    This used to work perfectly, but now I can't get ASCII 31 (or arrow down to work). The real killer is that other techs in my school district have eMacs running tiger with same commands that work (some have to arrow down 16 times to get to correct test version). The other commands (like command 1 and returns, command n) all work fine! Hate to have to touch 80 machines each day to select proper test version when we log in.
    Any Suggestions????

    Try this form of the line:
    keystroke (ASCII character of 31)
    That's worked for some people. Hope it works for you. If it doesn't work as given, try without the parentheses.
    Regards.

  • QuickTime movies cannot display properly, refresh doesn't work propely for html files on hard disk, opening a new tab doesn't work

    Hi!
    I have tried Firefox V4 (but have since reused V3.6.16). The following problems were found:
    a. Cannot display the controls used for QuickTime movies.
    b. The refresh button doesn't function at all if the html files reside on the hard disk. I do this because I need to test the appearance of the web page before uploading to the server.
    This problem also exists for v3.6.14 to v3.6.16
    c. When opening a new tab, it doesn't work. Instead, it will open another instance of the browser. By right, it has to open the web page on the same instance of the browser.
    This is my feedback.
    Thanks!!!!! :)

    I had some advice to try recording QT audio and adding to the slide.  Now, when recording to Quicktime, it does embed it, but in recording the presentation, it either doubles up the audio giving a strange echo or does the same thing if you ever edit the presentation.
    The problem Keynote has is that the sound and image content are not locked together which causes out of sync errors. This is why many users choose video editing applications when using sound in the presentations, as they have both image and audio tracks to sync sound properly together.
    Start a new presentation to remove the previous sound recording, Keynote is holding onto the other sound files.
    Add the graphic items to each slide and one sound file to each slide for the voice over
    1 - In Inspector > Transitions;  use start transitions automatically and set each transitions delay to the duration of the individual sound file.
    2 - In QT export, set Fixed Timing and delete the value in the duration box, QT will then use the custom timings for each individual slide.
    This procedure does work exactly as needed, Iv used this for nearly 6 years using 4 different versions of Keynote.

  • Restart command doesn't work

    I believe the following problem began when I updated to 10.4.9. I can't be absolutely sure but the timing seems about right. I've since updated to 10.4.10 in an effort to fix it, but haven't succeeded.
    The problem is that when I select the Restart command in the Apple menu the computer will begin the process, all open apps will be quit, the finder will quit, my desktop will go to blue to a few seconds. Then the monitor will go blank. Then nothing after that. I DO NOT get the startup chime. The machine is still powered on, the light above the power button is still lit. If I leave the machine for any length of time the fans will start speeding up gradually until they're at full tilt. After 4 or 5 minutes it becomes obvious that nothing is going to happen, so I need to manually shutdown via the power button.
    Does anyone know what logs I can post here to help in the diagnosis? This also happens if any installer application needs to perform a restart, ie Software Update.
    Thanks,
    Chris

    Hi chris catalano-
    I have had updates make my machine do some crazy stuff just as you describe. I would actually let it go for 15 or 20 minutes before declaring it a no-go.
    If that doesn't work, try resetting the SMU and see if that helps: How to reset the SMU on a Power Mac G5 (Late 2004) or Power Mac G5 (Late 2005)
    Luck-
    -DaddyPaycheck

Maybe you are looking for

  • Unable to print multiple copies of a PDF

    I am running Adobe Reader X version 10.1.3 on a MacBook Pro with Mac OSX 10.7. For some reason I can only print one copy of a PDF at a time, even if I set the number of copies in the print dialogue box and the Printer dialogue box. Help!  It's very f

  • Old web page is not cleared?

    My iPad sometimes briefly displays a web page that was viewed some days before even if history and cookies were cleared how can I stop this.

  • OSB jms 2 ftp/file

    Hello My configuration: JMS Proxy Service(byte stream) - > ftp/file Business service I can write stream to ftp/file without convert to array? Best Regards, lam

  • Reference cursor

    anybody have knowledge about reference cursor. please share it with me

  • Oracle equivalent relation terms for History Notes and Abbreviation

    Hi, We are trying to migrate from Basis 9 database to Oracle 10g. The biggest challenge isto build a oracle thesaurus similar to the one in Basis. In Basis we have relations History Notes(HN) and Abbreviation(AB). I am not able to find equivalent rel