"Hot Folder to FTP" script review please

I'm trying to make a folder on my Mac that is a "Hot Folder." I want this folder to have an action/script that as soon as it sees a new file added it will open Fetch and upload via mirror to an FTP folder.
I was able to make the Fetch portion of the script without issue, but making the folder "Hot" is a bit more difficult for me. I tried to use some script from the sample script "add - new item alert" but have been unsuccessful. I'm hoping some of you Applescript pros can review this and tell me how to correct. Or perhaps you know of a better way to make this work with automator.
SCRIPT:
on adding folder items to this_folder after receiving added_items
try
tell application "Finder"
--get the name of the folder
set the folder_name to the name of this_folder
end tell
-- find out how many new items have been placed in the folder
set the item_count to the number of items in the added_items
--create the alert string
if the item_count is greater than 1 then
tell application "Fetch"
activate
make new transfer window at beginning with properties {hostname:"ftp.hostname.here", username:"myusername", password:"mypassword", initial folder:"/pub/pao/images/"}
mirror alias "Macintosh HD:Users:Bill:Desktop:test:" to url "ftp://myusername:@ftp.hostname.here/pub/pao/images/" format Automatic without delete strays
end tell
end if
end try
end adding folder items to
Thank you all!

Well, the most obvious problem is:
if the item_count is greater than 1 then
If you drop a single file into the folder, nothing will happen. That's because item_count will be 1, not greater than 1.
If you don't care about how many files were dropped (because Transmit's mirror function will just synchronize the differences, then omit this line altogether - the script won't fire unless at least one file was added.

Similar Messages

  • Hot Folder for FTP Script

    I'm trying to make a folder on my Mac that is a "Hot Folder." I want this folder to have an action/script that as soon as it sees a new file added it will open Fetch and upload via mirror to an FTP folder.
    I was able to make the Fetch portion of the script without issue, but making the folder "Hot" is a bit more difficult for me. I tried to use some script from the sample script "add - new item alert" but have been unsuccessful. I'm hoping some of you Applescript pros can review this and tell me how to correct. Or perhaps you know of a better way to make this work with automator.
    SCRIPT:
    on adding folder items to this_folder after receiving added_items
    try
    tell application "Finder"
    --get the name of the folder
    set the folder_name to the name of this_folder
    end tell
    -- find out how many new items have been placed in the folder
    set the item_count to the number of items in the added_items
    --create the alert string
    if the item_count is greater than 1 then
    tell application "Fetch"
    activate
    make new transfer window at beginning with properties {hostname:"ftp.hostname.here", username:"myusername", password:"mypassword", initial folder:"/pub/pao/images/"}
    mirror alias "Macintosh HD:Users:Bill:Desktop:test:" to url "ftp://myusername:@ftp.hostname.here/pub/pao/images/" format Automatic without delete strays
    end tell
    end if
    end try
    end adding folder items to
    Thank you all!

    Well, then. I thought wrongly, I haven't used those in a very long time and thought they were saved.

  • Aperture Hot folder not importing after first picture?

    I'm shooting a Leica X1 with aa Eye-Fi Pro card- I've set up everything correctly including the latest aperture Hot Folder. It worked fine a few times.
    Now it's not importaing anything after the first JPG (and I'm shooting JPG+DNG Pairs). Someone else in the community had the EXACT same problem but just said they "solved" it without explanation.
    Eye-Fi imports it into the folder, but the Hot Folder script doesn't automatically move it into Aperture. I've tried quitting and restarting both apps, and even reinstalling the hot folder app.
    First, you've got to be kidding me that we are using such a rinky-**** script. If I paid $99 for a **** card that's only feature over the lesser model is that it works with RAW, why do they not integrate into Aperture natively? Why do they think that only iPhoto integration is enough? Who is using iPhoto with RAW files (I'm sure there are some but come on the majority will be using Aperture). Plus this script doesn't save information as basic as which folder is the hot folder or which Aperture project I want it going into. So every time I start up my computer I have to go through thr 5 or 6 step process of re-linking. COME ON.
    Second, how do I fix the fact that it's NOT working? Right now I've got several pics in the hot folder and it's not importing them. Thanks.

    It would appear that the majority of this post (the complaining parts) should be directed to the Eye-Fi people. None of this has anything to do with Aperture. Why they have never actually  intergrated with Aperture is something you have to ask them.
    As for the hot folder script, that script has been around since at least 2006 without change. It is possible that it might have problems wiht Lion as there have been some changes regarding scripting with Lion. The script, while a nice bit of AppleScripting was never  a comercial product. It does what it does. Again your complaint about the workings of the script should be directed at the Eye-Fi folk as they recommend using it to use their card with Aperture.
    One thing you can check is to make sure the script is attached to the folder you are importing the images into.
    regards

  • File Stuck in hot folder

    I have files always stuck in hot folder and doesnt go through to command work station, those files can't be deleted either until i restart server, is there any other way i can do to push the files through?

    That really should not be happening. FFC will automatically remove files off the hot folder when it pulls the job.
    Please escalate to the hotline so they can take a look.

  • Hot Folder to Force File Permissions?

    I have a system wherein files are automatically pulled from an FTP, and are placed in a specific folder on our Mac Server running 10.5.  The issue is that the files when pulled have their permission as "No access" to user everyone.  Is it possible to create a hot folder that automatically changes everything put into as "Read Write" to user everyone?
    Thanks!
    R~

    Hi
    Are you propagating POSIX permissions or ACL Permissions? if you're only propagating POSIX permissions it won't work and you'll soon end up back to only creator/owners of files and/or folders having read/write access and everyone else read only.
    If you are propagating ACLs and you're having to do this regularly then there's something wrong elsewhere? It's a good idea not to share the volume but rather a folder within the volume. If ACL permissions are not propating properly or they are not sticking after propagation then un-share the share, rename the folder, create another folder named the same as it was before you renamed it and transfer the contents of the olf folder to the new onr. Re-share that new folder, add users or groups to the ACL Window, define appropriate permissions and re-propagate. This should now work without any further propagation.
    If it's still not working I would start troubleshooting possible drive/directory issues. Use something like DiskWarrior or even Disk Utility. If the share(s) are on a non-boot volume then un-share the shares, do what you have to and re-share them again. Re-propagate afterwards. I can assure you this does work and works well but if there are underlying issues with either the Server Configuration (possible) or the drive/directory structure (more likeley) of the volume where the shares are stored you will see problems.
    HTH?
    Tony

  • Document Updates in a folder via FTP considered Publish Points?

    Hello,
    We currently have a website that is deployed via IIS that we are planning to move to Azure Web Services.
    This web contains a folder in the web site directory that contains files and documents for users to download. The site itself contains code that manages the files, and presents specific files to specific users.
    Throughout the month, these files and document gets updated (additions as well as replacements); even though the website does not get updated.  Users use FTP to transfer files into current folder on the IIS server.
    The issue we are facing:
    My concern is that updating documents in this folder via FTP does not create a publish point (and considered as dynamic changes) and if the site is re-deployed or scaled, the document changes are not picked up.
    Can anybody confirm that: If we use FTP to update documents in this folder, Azure Web Services will recognize this as a Publish Point?
    Thank you.  Your help is very much appreciated.
    PCR.

    Thanks for the reply.
    I confirmed that we are using Azure Websites.
    We had a previous website with a similar situation where the website contained a folder with documents (pdf, doc, and xls).  Files were added into this folder periodically.  Then one day we noticed that a number of files were missing.  When
    we researched the problem, we were led to believe that something on the back end moved the website to a different server, and used a previous instance of the website.
    Our web development manager thought he found an article that stated that we should not keep dynamic files within the website structure.
    It would be great if this is no longer the case (or that we are mistaken in our interpretation).

  • Powershell- FTP Script to copy files only after a certain time

    Hey guys,
    We are currently running an FTP script that decrypts pgp and copies/moves several files to different archived and production locations. These files come in constantly throughout the day and we need to ensure a certain 8 files get moved to 4 different locations
    but NOT before a certain time.
    Ex: File1 and File2 are received EARLY along with 50 other files and decrypted at 9pm EST on 9/4. File1 and file2 need to WAIT to be moved until after 12:05am EST on 9/5 or it is slapped with an incorrect $date/time and not processed correctly but
    every other file needs to be moved (which is currently all configured).
    Right now, both file1 and file2 are being moved as the script runs  (every 10 minutes) so when the files come in early from the vendor- they get the incorrect date/time stamp.
    I'm fairly new to powershell so I'm not quite sure how to set this up to only move the file if it is between a certain time- say 12am-1am and no other time.

    I was able to resolve this myself by doing the following:
    $hourdate = get-time –uformat “%H” 
    #Copy-Item as long as time is in the 12:00am or 1am hour 
    if(($hourDate -eq "0")-or ($hourdate -eq "1")) 
    copy-item objects
    Thanks guys

  • Parent/Action Script advise, please

    Hello
    I am posting to ask for some advice. I have Flash MX 2004.
    I have a series of thumbnails (Movie Clips) which seem to be
    arranged over two layers (layers 1 and 2). Layer 1 holds each
    individual thumbnail (movie clip) in several keyframes, so that
    with Layer 1 highlighted, when I click on frame 1 I can see
    thumbnail no. 1 on the stage, when I click on frame 2 I see only
    thumbnail 2 on the stage, when I click on frame 3 I see only
    thumbnail 3 on the stage, etc.
    I see no Action Script when I click through the frames:
    Layer 2, however, does appear to hold Action Script. Please
    see here:
    http://www11.brinkster.com/stevehigham/parent.html
    When I click on Layer 2 frame 1 I can see Action Script for
    the first thumnail:
    gotoAndStop(_parent._name);
    When I click on frame 2 I can see my second thumbnail, but
    the same script:
    gotoAndStop(_parent._name);
    When I click on frame 3 I can see my third thumbnail, but
    again the same script:
    gotoAndStop(_parent._name);
    I am trying to get my limited cognitive ability to grasp how
    the file works (I bought it as a template) so that I can change it.
    I wish to ask two questions. Does the gotoAndStop(_parent._name);
    mean that every time I click on thumbnail 1 I go to this file:
    --> _parent._name?
    And does it mean that every time I click on thumbnail 2 I
    also go to this file: --> _parent._name? Does it also mean that
    every time I click on thumbnail 3 I go to the same file: -->
    _parent._name?
    When I go to Ctrl + Enter and click on the thumnails
    (regardless of which one it is), I am always taken to the same
    place. Is it this script, the _parent._name that takes me there? If
    so, my second question concerns how can I change it - what is it in
    the script that I need to change - so that each thumbnail takes me
    to a different place?
    Many thanks for reading such a long message!
    Steve

    Hello kglad
    Thank you for your message.
    In relation to your comment:
    'you need to label your frame and you probably are supposed
    to load that swf into another swf'.
    How do I do that? If I create something new on my stage in a
    new layer in the first frame how to I change the Action Script so
    that when the thumbnail is clicked, I go to that particular frame
    in that particular layer?
    Thank you for your help.
    Steve
    Text

  • Need help with simple folder action or script

    I have created an export preset in Lightroom that exports images to a folder called "To Email" on my hard drive, and then automatically attaches those images to a new email in my email client (Mailplane).
    It's a great solution that allows me to send a photo via email with one click from Lightroom. However, I want to take it a step further by creating a folder action or script that automatically deletes the image after it is attached to the email. This will allow me to put the folder somewhere deeper in my file system without having to worry about cleaning it out all the time.
    Unfortunately, I have no experience with Automator or AppleScript. Can you help? Thanks.

    I think you need to rework elements of your workflow.
    For example, you say the export preset creates and sends the email.
    If this is the case, the the logical place to make your change would be to edit that preset action (I don't have Lightroom to know whether this is an option there or not).
    The problem with using a Folder Action is that the Folder Action will trigger when the file is dropped in the folder, but that will be before the email is generated or sent, so you run the risk of deleting the file before it's sent.
    So if you can't edit the export preset to do the deletion I would suggest decoupling the 'send an email' and 'delete file' elements from the Lightroom action - in other word change Lightroom to just export the file, and have a separate folder action that triggers when files are added to that folder. The folder action script can take care of generating the email and sending it out, knowing when the email is sent and therefore when it's safe to delete the file.
    WIthout seeing more of the current workflow it's not easy to be more specific.

  • CSS ftp script

    Hello,
    I use a CSS to load-balance ftp server. To validate the availability of my ftp servers, I would like to write a script that logs on each ftp server and then tries to get a copy of a small file on the server (the file are not stored locally on the ftp server, so I need this to validate that the server is able to retrieve the file from my storage).
    Is it technically possible or not using scripts ? (the ftp script provided by Cisco only logs on the server)
    If yes, has anyone already done this ? How can I do this ?
    Thanks,
    Gaetan

    Gaetan,
    you could take the existing scripts and add more function to RETR a specific file.
    However, downloading the file itself would be difficult and useless.
    I would suggest to just send the RETR command and check the server response.
    Gilles.

  • Is it possible to create a hot folder for batch processing?

    I know that it's possible to make a droplet for preflight, but is it possible to create a droplet or a hot folder for another batch processes (mine crops the pages)? Or at least make a keyboard shortcut? It's so unproductive to go Advanced>Document Processing>Batch Processing>Run>Close (Adobe spoiled us with custom shortcuts in other programs)...

    HenrikAppleJespersen wrote:
    is it possible to create a hot spot with apple Airport express 2 generation and use it i a hotel with ethernet wall socket and use it with my Ipad 2?
    Yes, it is one of the things AirPort Express was specifically designed for.

  • Gallery script help, please

    Gallery script help, please
    Hello,
    I'm new to actionscript in general, I do know a little...
    I foung a gallery script, modified many things, the images
    open fine, everything is working, but here's the thing:
    the gallery is in 3 sections, red, blue and yellow.
    I would like to know how, what, and where to put a script so
    that if a "the small red image #1" is clicked, I can load any sort
    of a movie on top of the "the BIG red image #1" or #2 or 3 and so
    on...same goes for the blue and yellow...
    If I figured things correctly on my own...the small thumbnail
    images of the gallery are not buttons, that's why I can't attach a
    movie (let's say) to them...but it is all written in script, using
    the horizontal and vertical position of the mouse to open the large
    images of the gallery...
    So, I don't know how to figure things out, to attach a
    specific movie to a specific thumbnail...
    p.s.: I think the script that controls the gallery is in
    symbol 120
    I really would appreciate the help
    Merry Christmas in advance to everyone
    Sandra
    here are all the files...
    http://www.gentro.ca/sandra_test.zip

    There's a great tutorial on kirupa...
    click
    here for link

  • I am not able to sign in with my exisiting Apple id, every time it is asking for review, please help me

    i am not able to sign in with my exisiting Apple id, every time it is asking for review, please help me

    Use this link to Contact iTunes Customer Service
    Apple  Support  iTunes Store  Contact Us

  • EA6500 - unable to setup Folder Access / FTP Server / Media Server functions

    I purchased the EA6500 a few days ago, and when I'm connected to Cisco Connect Cloud I am unable to select Folder Access / FTP Server / Media Server.  I click them and nothing happens.
    Also, the Cisco light on the router keeps blinking.  I'm googling to find out how to troubleshoot these situations but I'm having no luck.
    I appreciate any help with these situations.

    DoublePromo wrote:
    I contacted customer service, and they helped me troubleshoot.  The description of the router and it's capabilites appears misleading to me - "Folder Access" - I thought it gave one the capability to file share between different computers that are on the same network.  It's only for files that are on a USB stick that's connected to the router.  Oh well.  Good thing I still have Network Magic Pro.
    In addition to this, storage functionality on the router doesn't need any software for it to work. The router should be able to detect the external drive when connected and get it configured on the router's interface unlike network magic which you've mentioned where the program must be installed to all computers in the network for it to be able to see all devices present in the network and share files and folders through it.

  • FTP script

    Hello,
    Does anyone know if there is a way to use FTP script from a
    coldfusion or html page? I need to run a QUOTE command. I am using
    version - Coldfusion MX7.
    Thanks, Tim

    Hi Tim -
    does this help?
    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_f_16.html
    timrande wrote:
    > Hello,
    > Does anyone know if there is a way to use FTP script
    from a coldfusion or html page? I need to run a QUOTE command. I am
    using version - Coldfusion MX7.
    >
    > Thanks, Tim
    Michael Evangelista, Evangelista Design
    Web : www.mredesign.com
    Forums: news://forums.mredesign.com
    Blog : www.miuaiga.com

Maybe you are looking for

  • Can the Graphics card on an iMac 24" be upgraded?

    Not an expert on graphic cards, but can the ones in an iMac 20" or 24" be upgraded whenever a better one is released? I don't mind taking it to the Apple Store if that's they only way to upgrade it. Also has anyone ever run Oblivion with Parallels or

  • Home Page - Dumb Question

    Is there a "home" icon somewhere that I am missing? Is the only way to return to your home page on Safari other than the keyboard strokes? In the help menu, it says to click home button on toolbar, but I can't seem to locate the button. Thanks

  • Af. sid . Hostname

    Hallo @ all. I have a problem when i want to see the Cache in Integration Builder. I have this Message: Unable to determine the name of the Central Adapter Engine from the System Landscape Directory at this time Notifications to the central Adapter a

  • Problem capturing sound with picture on Premiere 6.0

    I've been using this system successfully for 10 years and I promise it's the last project with it, I'm going HD with CS4 next month. But... Using Premiere 6.0. MAC G4 Dual 1000 processors, lots of RAM, 4 hard drives. For some reason when I capture a

  • Best way to store and check a NodeList

    Hi, I hope that this makes sense. In my code below, I have to, and ignoring the first one, check if the XPATH expressions are equal in first and second TSTs and second and third and so on & if they are not equal - I issue the ticket. But I don't know