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.

Similar Messages

  • "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.

  • 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.

  • Temp folder for FTP Export Plugin

    I am having trouble with a plugin that someone on my staff created.  It utilizes the FTP export LUA files, and I am not certain WHERE the files are temporarily stored prior to upload.
    The problem is intermittent, wheas the images sometimes appear partial / corrupt/ or solid black.   I solve it by re-uploading.
    Does anyone know where / how to find the temp location?
    Thanks in advance!

    during export the source path is readily available as rendition.photo:getRawMetadata( 'path' ) - is that what you meant?
    I think that's exactly what I was looking for.  In quick test it looks like it will work great. 
    Again, I'm a newbie to Lightroom SDK.  I figured that what I wanted was probably simple, but after spending over an hour searching on keywords that didn't find a good answer, I figured it was time to ask a human.
    Many thanks for the quick and very helpful reply!
    --Rik

  • Dreamweaver cs6 fails to create a folder for the scripts

    Dreamweaver CS6 does not automatically create a folder to store the scripts therefore the navigation bar is not created as it should? Does it need to be re installed on the network. Is it something on the network that prevents it from creating the folders?

    I have no trouble creating folders manually in the local site Files panel (F8).  Right click on sitename.  Select New Folder.  Name it.  Move scripts into to that folder.
    Nancy O.

  • Custom home folder for BC FTP accounts?

    Does anyone know if you can customize the home folder for FTP account/login to BC like you can with other hosting providers? I know you can manage access with account roles, but I don't think it goes as specific as what folder on the server can be accessed by a specific account. Right now all FTP accounts login straight to the root folder.

    Hi Steve,
    Unfortunately you cannot control or customize this further via BC FTP.  The system will always open in the root.  All you can do via FTP is create/delete new folders as well as upload/remove files. 
    Kind regards,
    -Sidney

  • 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

  • Os command for ftp server

    I use file adapter receiver channel to transfer messages to external ftp servers. After a file is transported to the ftp server completely, I need to run a OS command to rename the file accordingly.
    My question is where I should put the OS command file? On XI or ftp server? Any blog on this topic available?
    Thanks!
    Regards,
    Hui

    Hi,
    Try using RUN OPERATING SYSTEM COMMAND AFTER MESSAGE PROCESING and RUN OPERATING SYSTEM COMMAND BEFORE MESSAGE PROCESING.
    You just post ur output file in some folder(Target) , lets say /usr/sap/sapout/test/.and the shell script in this path /usr/sap/bin/convert.sh (use ur Rename logic here).
    Inside the File access parameters put target directory and filename scehme and for shell script give processing parameters as File construction mode , File type and OS Command and use a space after the shell script name and the %F.
    And for input can use it directly.
    For the shell script (which u will use to rename the file after processing) you can put anywhere inside /INTERFACE/XI/ but athe time you provide the pat it will be exactly matching as from where you are using the Shell Script and the file at the coressponding places. It shud be in XI. Thats it and u r done.
    Check out these links. First one will help you in acheiving want you want.
    /people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi
    /people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
    /people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching
    http://help.sap.com/saphelp_nw70/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm
    I hope this will solve your problem
    Regards
    Aashish Sinha
    PS : reward points if helpful

  • Folder for each cd instead of each artist

    My iTunes library contains over 60GB of 256 kb/s AAC songs. When I started to use iTunes I choose to let iTunes manage the Music Folder. This resulted in a separate folder for each artist, but all I really wanted is a separate folder for each cd!
    Is there a script that can organize my current iTunes Music Folder into folders for each cd instead of folders for each artist? This would save me a tremendous amount of time. Thanks.

    Thank you all for responding!
    The reason for having iTunes organize all music by cd rather then by artist, is that I want to add and remove cd's already converted to aac in a convenient way to the iTunes folder (because the hdd of my PB is as good as full).
    Some of the compilations cd's are placed in the compilation folder but most aren't. So what has happened is that I have an artist folder with several sub folders in it with songs that belong to compilations. In order to remove an entire compilation I will have to find each track belonging to that compilation by hand. Now if every track from a certain compilation would be placed in a folder with the name of the cd, I could easily cut and past that folder to a backup drive and replace it with another folder.
    Hence my request for a way to place all files belonging to a compilation in one folder with the name of that compilation. That's my objective. But something tells me that I do not know iTunes as well as I thought!

  • Creating a folder for a document library in SharePoint online

    Hello I am looking for a good place to get started on creating a folder for a document library using a powershell script. Thanks in advance for any help.

    Here is a guide to creating folders and items in a document library for SharePoint Server/Foundation: Creating SharePoint Folders
    and Items with PowerShell. You will need to tailor it to your needs as it's a demo for creating 50,000 items.
    That's step 1 and contains the bulk of what you would need to do. Here's an example of connecting to a library in SharePoint Online using CSOM: Office
    365 - PowerShell Script to Upload Files to a Document Library using CSOM. You won't be uploading files, but the parts where you connect and get a list are what you're interested in.
    Now you'll combine bits from both of these scripts:
    1. Connect to SPO
    2. Get your list (looks like you need to first get the site collection and then the site)
    3. Create a folder
    I figure it would look something like this (note I haven't tested this at all):
    #Specify tenant admin and site URL
    $User = "[email protected]"
    $SiteURL = "https://tenant.sharepoint.com/sites/site"
    $DocLibName = "DocLib"$FolderTitle = "Example Folder"
    #Add references to SharePoint client assemblies and authenticate to Office 365 site - required for CSOM
    Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
    Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
    $Password = Read-Host -Prompt "Please enter your password" -AsSecureString
    #Bind to site collection
    $Context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
    $Creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($User,$Password)
    $Context.Credentials = $Creds
    #Retrieve list
    $List = $Context.Web.Lists.GetByTitle($DocLibName)
    $folder = $list.AddItem("", [Microsoft.SharePoint.SPFileSystemObjectType]::Folder)
    $folder["Title"] = $FolderTitle
    $folder.Update();
    Jason Warren
    @jaspnwarren
    jasonwarren.ca
    habaneroconsulting.com/Insights

  • Deleteing folder for multiple users

    Good morning all -
    As most people would admit, I am terrible at scripting in any form.  In short, I need assistance with a dummy proof script to delete the contents of a folder for multiple (150+) users, without  having to touch each users profile.  I would
    prefer to be able to execute the script when needed.  This won't be listed as a scheduled task or setup as a netlogon. The path is as follows:
    C:\Users\michael.jannise.ctr\NS5\tmp
    It can either be set to delete the tmp folder entirely, or just the contents of the folder.  Which ever is easier. 
    I would greatly appreciate any assistance provided!
    Regards,
    Michael

    I was going to warn you but this is more fun.
    Understanding Windows and the Windows file system is always a big problem for non-technicians.
    Learning this technology requires some time for testing things until you understand how they work. You really cannot learn this by asking people on the Internet to give you answers.
    The command, as posted. removes only the "tmp" folder contents. How to make that clear is not clear. It needs to be tried. THe safe way yo do thisis to make a parallel structure and test that.
    ¯\_(ツ)_/¯
    Well, I can play the game!  :)  I know I should spend the time working with this type of technology but, I would not execute it day to day and would most likely still make mistakes. 
    I am extremely grateful for people like yourselves who are willing to share the knowledge!

  • How to scan a specific folder for the existance of a PDF before saving

    I created a folder level function for saving a file by passing it a name and a path.  The problem is I don't want to allow the user to overwrite a file of the same name.  I would rather want to append a version number to it's name so I can keep track of the evolution of the form.
    I'm thinking about a script to scan the folder for the occurrence of a file and returns something or throws an error.  I experimented with app.browseForDoc() but I don't want the dialog box to show.
    I would use a do/while loop to appends a version number and then look for the file until I get a specific return value or error indicating that the file is not present (or in my case that the name is not already used).

    I think I have just the answer, I still need to try it though.  I forgot about prompting the user for appending version numbers because it would mean he'd have to cancel a bPromptToOverwrite box for each version present in the folder.  That's way too many boxes.
    BUT....;o)
    I needed a way to prevent overwriting which is the first concern.  What I'm looking for is a way to:
    1-stop my save script before overwiting;
    2-Append version number if script stops and launch save script again;
    One way to stop the script is when an error is thrown.  I'm thinking about saving the file as a copy with the bCopy parameter and adding a DOS script to the folder that would monitor in real time the attributes of all files and turn it to read-Only.  That way, if I run my save function and reader tries to overwrite a file, it will throw an error.  I will modify my save function to return a boolean named successfulSave.  Using a try/catch handler, I will append a version number to the file name and call the save function again.  I will encapsulate this in a do/while loop until successfullSave is true.

  • Architectural design for FTP batch processing

    Hello gurus,
    I would like your help in determining the design for the following.
    We receive several HL7 messages as a text file and copied to a shared network folder. All these files are created into several different folders depending on the region, message type. We need to come up with a B2B process to read all the files from the netwrok folder using FTP (batch process) and translate if needed (depending on the scenario) and transfer the files over to other destination folder on the network (using FTP).
    For this, we can create TPs with Generic FTP channel and this works without any issues. By doing this way, we need to create TP for each and every type of message which reads the files from its own specified directory location on the network based on the the polling interval.
    My question is, instead of creating TPs for each and every type of file, is there a way by which I can write a common web service that reads the source files from the network and based on the type of the file route to the proper destination folders. If it is possible, I would like to know the architecture for accomplishing this task.
    I really appreciate your kind help on this.
    Thanks and regards,
    Raghu

    Hi Raghu,
    Is it a B2B communication scenario?
    By doing this way, we need to create TP for each and every type of message which reads the files from its own specified directory location on the network based on the the polling interval.Why cann't you have only one TP with multiple documents, channels and agreements?
    My question is, instead of creating TPs for each and every type of file, is there a way by which I can write a common web service that reads the source files from the network and based on the type of the file route to the proper destination folders. If it is possible, I would like to know the architecture for accomplishing this task.Depends on your use case and products you want to use. You can very well use FTP adapter with BPEL and poll for files. Use DVM in composite to figure out the destination and send it there. You may use OSB if it is a typical routing case with heavy load and performance is a concern. You may use B2B as well here. So ultimately you need to figure out what you want and what tools you want to use.
    Regards,
    Anuj

  • Looking for a script to automate renaming layer objects, not the layer itself!

    Hey there everyone,
    I was wondering if there is a possibility to create/have a script for an automated renaming of several named layer objects in Indesign (CS6).
    The situation, I'm facing is a document for a templating process with at least 80 layers and sometimes some special elements on each layer. The naming of the layers is kind of repeating for each page that is used. The only difference is some prefix change in the layer name and/or the name of an element itself. My problem is, that I need to rename most of those layers AND elements in a same way and I'm looking for a script that asks me for the name of a layer or element (perfect would be just a part of the name to have multiple steps at once) and I have the chance to type in the desired value. It affects frames, graphical elements and text boxes.
    If anyone has an idea, how to simplify this process I would be very glad to get some informations or advices.
    Thanks in advance
    Ralf

    Here is a more descriptive version of the script above... :)
    # Change "PSDrive" to PS1: (Sitecode)
    CD PS1:
    # Get all CMPackages to $CMPackages_All Variable
    $CMPackages_All = Get-CMPackage
    # Set the DP to use with. You may need to run it again with other DP just in case some Packages are missing...
    $DPName_FQDN = "YourDP.Contoso.com" # Your FQDN DP name to reference from.
    # Set folder to store *.pkgx files
    $FilePath = "E:\_ESD\Prestage\" # FilePath
    # For all CMPackages
    foreach ($obj in $CMPackages_All) {
        $packageType = $obj.PackageType
        $packageID = $obj.PackageID
        $packageVendor = $obj.Manufacturer
        $packageName = $obj.Name
        $packageVersion = $obj.Version
        # Formulate File name based on Vendor Name, version and PackageID
     $FileName = $FilePath + $packageVendor + "_" + $PackageName + "_" + $packageVersion + "_" + $packageID + ".pkgx"
        # Replace space with underscore
        $FileName = $FileName.Replace(" ","_")
        if ($PackageType -eq 0) {
            if (!( Test-Path $FileName)) { # This makes the package to skip if it is already created.
                Write-host "Publishing CMPrestage Content for $PackageID $PackageName to $FileName via $DPName_FQDN ..."
                Publish-CMPrestageContent -PackageID $packageID -DistributionPointName $DPName_FQDN -fileName $FileName -ErrorAction Continue
    YPae

  • 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).

Maybe you are looking for

  • Error message in the log file

    Hi, I'm running CF 7.0.2. The app is using Flash forms. I have this onError function in my Application.cfc. <cffunction name="onError"> <cfargument name="Except" required="yes"> <cfargument name="EventName" type="string" required="yes"> <cflog file="

  • Account Group Report

    Dear All Is it possible to see the Vendor balances Account Group wise.  The user wants to only enter the Vendor Account Group which he gave during configuration and wants a report based on that Account Group... Thanks & Regards Kanwaljit

  • Restricting number of rows in EJB  QL    using rowNum or rowId

    Hii Javaites I am using EJB finder methods to get a a list of records from database. Now i want that only particular number of records should be fetched. For tht i want 2 use rownum or rowId. Can anyone plz tell me can we do tht in EJB QL. I m using

  • Compare date with implements Comparator

    I have a DefaultListModel (mode) staffed with EMPL (id, name, startingDate). I would like to sort the defaultListModel accourding to the dob. for this I do the following:                Object[] contents = model.toArray();                            

  • Problem with changing double to int!

    Hi guys. I've got a major headache trying to solve this problem, and I'm hoping maybe someone abit wiser than I could help me out. I've added two lots of code, one where if I input 10 as the distance I get an answer of 423.529411..etc. However I want