How to do something with the moved file ???

I bet it is easy, but as I am new to AppleScript, still need help..
This is a folder action. When a new file is added to the folder, the folder action script runs, and if the file name contains a particular text, then the file is moved to another folder - in this case, it is moved to a folder on an external hard drive. It is described in this script:
copy name of thisItem as string to FileName
if FileName contains "House" then
move thisItem to POSIX file "/Volumes/ALL/House/Season 5/"
The problem is - in that folder (/Volumes/ALL/House/Season 5/) I also have set a folder action, that, for example, converts or opens every file added to folder. The things is that, it is rather slow to run 2 folder actions and I don't know why it is so, but I guess it is because of the external hard drive. My aim is to remove the folder action for the folder (/Volumes/ALL/House/Season 5/), and do everything in the initial folder action.
So the question is - How can I operate with (for example, convert or open the newly added file) the file added in the folder (/Volumes/ALL/House/Season 5/) via the first folder action script?
Or in other words, how do I use the newly added file? I tried to do it like this:
copy name of thisItem as string to FileName
if FileName contains "House" then
move thisItem to POSIX file "/Volumes/ALL/House/Season 5/"
open thisItem
But obviously, it opens the original thisItem! So how can I do something with the newly added file in the location /Volumes/ALL/House/Season 5/ ???
Cheers and sorry for my english!
Message was edited by: reinisb

But obviously, it opens the original thisItem! So how can I do something with the newly added file in the location /Volumes/ALL/House/Season 5/ ???
That's easy - you know the file name and you know the directory you copied the file to, so instead of:
open thisItem
you just:
open POSIX file "/Volumes/ALL/House/Season\ 5/" & FileName

Similar Messages

  • How to save pictures with the config file "Write Key.vi"

    hi all,
    On my front panel I've few controls pictures containing photos (JPG type) . The user can select the photo he wants using the classic file dialog box.
    Usally I use the config files VI's to save the control values from one run to another one. In the config files VIs, I use the polymorphic "write Key.vi" wich accept only booean, I32, U32, path, and string dada type, but no picture !
    I've tried the "flatten to string" fonction (picture --> flatten to string --> writekey.vi) , no broken wire but the conversion is very very too long and to heavy (20Mo a key!).
    another way, would be to write in a xml file, I've also tried but I've always get the 1104 error: No end tag was found for an XML start/end tag pair.
    can someone help me.
    what is the best way for  retrieving controls pictures with photos

    Hi GerdW
    Many thanks for your quick answer. Always happy to get advises from fellow programmers.
    You suggest to use the "path" input of the "write key.vi" (configuration file utilities) to retrieve photos that a user would have selected in a previous run. Could be a good solution in a number of applications but what I would like to do is like in a excel or word file. Once a photo has been embeded in one xls file for ex., I find it back each time i open this xls file, even if the original photo's file has been deleted or if my application runs on another computer.
    xml file looks interesting for that purpose (i mean used as config file). I can easily store in a xml file a labview picture (like a colored rectangle e.g.) but when i try with a photo (wich is a also a picture) labview returns always the error 1104.
    How to fixe this error, or maybe  there is another way to store photos in a config file without passing through xml,
    kind regards.

  • How to work with the remote file system

    Hi all,
    I want to know how we can work with the remote file sytem.
    Code should be some thing like
    File f = new File("//10.22.33.122/images")
    images is share name..
    i want the file names of all the images in that shared folder...
    Thanks in advance,
    Srinivas N

    try this one:
    File f = new File("//10.22.33.122/images")
    File[] files = f.listFiles(new FilenameFilter() {
         public boolean accept(File dir, String name)
    // Specify the extentions of files to be included.
         return name.endsWith(".bmp") || name.endsWith(".gif");
    // get names of the files
    String[] fileNamesArray = null;
    for (int indx = 0; indx < files.length(); indx++)
    fileNamesArray[indx] = files[indx].getName();
    return fileNamesArray;

  • Pick a particular file and keep on target side with the same file name

    Hi Guys,
    I have got couple of files in a folder. I need to pick only two files, I have setup BPM procedure 2 payloads merge. To keep these merged file with  the same source filename.
    Source side file Directory
    abc_12345_20100408101029.xml (abc_seq number_timestamp.xml)
    xxx12345.xml
    test.xml
    abc_12345_20100408101149.xml
    Target Side, How do I keep with the same file name?
    abc_12345_20100408111239.xml ---  same file name with diffrent timestamp.
    One more question: How to setup a file adapter to trigger between 2:00am to 5:00 am? in a particular time
    Does anybody has got quick idea, any links etc.,
    Your quick and positive response will be much appreciates.
    Kind Regards
    San

    Hi,
    One more question: How to setup a file adapter to trigger between 2:00am to 5:00 am? in a particular time
    For this you can Availability time planning (i.e you can schedule the file adapter to poll for the files with in the time interval i.e 2 -5)...
    for generating the file name at target side you need to look for the Dynamic Configuration as you need to change the timestamp for the file..and i am not sure how this works in BPM..
    in normal scenarios dynamic configuration will help....
    HTH
    Rajesh

  • Since installing Lion I keep getting the error message 'there was a problem connecting to the server. URLs with the type 'file:" are not supported"' How can I fix this?

    since installing Lion I keep getting the error message 'there was a problem connecting to the server. URLs with the type 'file:" are not supported"' How can I fix this?

    A Davey1 wrote:
    Not a nice answer!
    Posting "Check the 'More like this'" area and not simply providing the answer is a great way to make these groups worthless.
    You're ignoring context.  On the old Apple Discussion Groups I never posted replies like that, instead giving people relatively detailed answers.  The new Apple Support Communities made things worse by introducing certain inefficiencies.  Then came Lion.  The flood of messages that came with Lion required a painful choice for any of the people who had been helping here: (1) Give quality responses to a few questions and ignore the rest.  (2) When applicable, give a brief answer such as the one that you found objectionable.  (3) Give up all the other normal activities of life and spend full time trying to answer questions here.
    People who needed help with Lion problems seemed to have trouble discovering existing message threads that described how to solve their problems.  I never posted the suggestion of "Check the 'More like this' area" without verifying that the help that the poster needed could be found there.  Even doing that, what I posted saved me time that I could use to help someone else.
    The people helping here are all volunteers.  None of them is being paid for the time they spend here.  They all have a life outside of Apple Support Communities.  It's arrogant of you to demand that people helping here spend more time than they already do.

  • Question. How do I update / modify my site? Do I work with the original file "modify"?

    How do I update / modify my site? Do I work with the original file "modify"?

    Not sure why modify is in quotes ... but yes you work with the original and then publish again or export the HTML again.

  • How do I access files that have been recovered (after a Mavericks problem) with the .cca file extension

    How do I access files that have been recovered (after a Mavericks problem) with the .cca file extension

    First, to access documents you must use an app designed for that specific Document type. So Pages will not be able to open PDFs. The Documents app by Readdle can handle PDFs though. In the latter case, you'd open the app, click the menu icon at its top left, and click Open to go to your iCloud Drive. With Pages, if you had files outside the main Pages folder, click + then iCloud and navigate to the file's location.
    Matt

  • HT201274 Can a Sprint Iphone 5 work with T-mobile network? How can one unlock with the MSL code? Sprint is not abiding by the Unlocking Consumer Choice and Wireless Competition Act.  FCC will only enforce if we file more complains.

    Can a Sprint Iphone 5 work with T-mobile network? How can one unlock with the MSL code? Sprint is not abiding by the Unlocking Consumer Choice and Wireless Competition Act.  FCC will only enforce if we file more complains.

    T-Mobile is a GSM network whereas Sprint is a CDMA network. They are incompatible. Sprint is not obliged to unlock a phone that is still under contract. Their phones may not be capable of being unlocked.

  • Everything on my screen, Mac Pro, shrunk!  Gmail, bookmark pane, task bar menu, even the password sign in. I'm sure I did something with the fingers thing. How do I get back to defaule

    Everything on my screen, Mac Pro, shrunk!  Gmail, bookmark pane, task bar menu, even the password sign in. I'm sure I did something with the fingers thing. How do I get back to default.  The font is tiny, tiny.  My operationg system is Mavericks.

    Thank you for the list, I will print and keep it handy.
    Contol F3 makes my whole screen larager or smaller. 
    Command option 8 does nothing that I can see.
    Command  option + or -  will zoom in or out on the page I am on but if I change windows it reverts.
    But bookmarks pane, the task bar, the password sign in and even the post I am writing (actually every printed word), are a font so small I almsost need a magnifiying glass.  This includes web pages too!
    I am using Mavericks. 
    Trying to retrace my steps when this happened.  Nothing unusual, I was using airplay to watch a You Tube segment on the tv.  I don't think that is related.
    I really appreciate your help and comments on this.  I can usualy google and find and answer, but to no avail with this one!

  • How can I hash with the MD5 for file

    I am a new learner in Java.
    Is there any useful code example or materials for me to learn how can i hash with MD5 for file.

    import java.security.*;
    import sun.security.provider.Sun;
    import java.io.*;
    import sun.misc.*;
    public class DigestOfFile
        public DigestOfFile(String mode) throws Exception
            assert(mode != null);
            digestAgent = MessageDigest.getInstance(mode, "SUN");
        synchronized public byte[] digestAsByteArray(File file) throws Exception
            assert(file != null);
            digestAgent.reset();
            InputStream is = new BufferedInputStream(new FileInputStream(file));
            for (int bytesRead = 0; (bytesRead = is.read(buffer)) >= 0;)
                digestAgent.update(buffer, 0, bytesRead);
            is.close();
            byte[] digest = digestAgent.digest();
            return digest;
        synchronized public String digestAsBase64(File file) throws Exception
            byte[] digest = digestAsByteArray(file);
            String digestAsBase64 = base64Encoder.encode(digest);
            return digestAsBase64;
        synchronized public String digestAsHex(File file) throws Exception
            byte[] digest = digestAsByteArray(file);
            String digestAsHex = encodeBytesAsHex(digest);
            return digestAsHex;
        private static String encodeBytesAsHex(byte[] bites)
            char[] hexChars = new char[bites.length*2];
            for (int charIndex = 0, startIndex = 0; charIndex < hexChars.length;)
                int bite = bites[startIndex++] & 0xff;
                hexChars[charIndex++] = HEX_CHARS[bite >> 4];
                hexChars[charIndex++] = HEX_CHARS[bite & 0xf];
            return new String(hexChars);
        private static final char[] HEX_CHARS =
        {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
        private MessageDigest digestAgent;
        private BASE64Encoder base64Encoder = new BASE64Encoder();
        private byte[] buffer = new byte[4096];
        public static void main(String[] args)
            try
                java.security.Security.addProvider(new Sun());
                DigestOfFile shaDigestAgent = new DigestOfFile("SHA");
                DigestOfFile md5DigestAgent = new DigestOfFile("MD5");
                for (int argIndex = 0; argIndex < args.length; argIndex++)
                        String base64Digest = shaDigestAgent.digestAsBase64(new File(args[argIndex]));
                        System.out.println("Base64 SHA of " + args[argIndex] + " = [" + base64Digest + "]");
                        String hexDigest = shaDigestAgent.digestAsHex(new File(args[argIndex]));
                        System.out.println("Hex    SHA of " + args[argIndex] + " = [" + hexDigest + "]");
                        String base64Digest = md5DigestAgent.digestAsBase64(new File(args[argIndex]));
                        System.out.println("Base64 MD5 of " + args[argIndex] + " = [" + base64Digest + "]");
                        String hexDigest = md5DigestAgent.digestAsHex(new File(args[argIndex]));
                        System.out.println("Hex    MD5 of " + args[argIndex] + " = [" + hexDigest + "]");
            catch (Exception e)
                e.printStackTrace(System.out);
    }

  • Problem with the PNG file icon

    Hello. This is the first time I'm posting something here, so please be merciful. :) Yesterday I saw that the file icons of the PNG files are not the blue ones (like we all know them, after installing Photoshop CS3), but the default Windows (I'm using Windows XP SP3) icons. I mean like when I don't have a program to open a given file, that is how it looks like. But when I double click on the PNG file it opens right away, so in my eyes there is a problem, of some kind, with the ICO file itself. The strangest thing is that this ICO file is not missing, deleted or moved! This happened only with the PNG files. All other Photoshop related files are ok and have their respective icons. Can someone tell me how to change the PNG file icon, so I can choose manually the ICO file.

    @roshlioto This is a windows issue NOT Photoshops. So wrong place on the Internet.
    However, you right click on the shortcut/icon whatever, (in Windows) and choose the icon/app you wish to associate with a given file.

  • Why does the new operating system not delete the moved files from their original location - it seems like an enormous waste of space, time and effort to clean up every file once you've moved it

    Why does the new operating system not delete the moved files from their original locations - it seems like an enormous waste of space, time and effort to clean up every file once you've moved it - also, when transferring large amounts of files it becomes a very large problem remembering which files were transferred and which not.

    You're going to need to be more specific, as I'm not quite sure I understand what you're talking about.
    If you're referring to copying from an external hard drive or flash drive, and you want to actually move files rather than copy them, you can hold down the option key to force it to do a "move" rather than a "copy." This is not new behavior, though... the Mac OS has worked this way as long as I can recall (and I've been using it since 1984).
    If you're having a problem with trying to move files from one place to another on a single drive causing them to be copied instead, that is likely because of some permissions issue preventing you from actually being able to move them.

  • How can I clean all the junk files from my iMac so that it can run faster?

    How can I clean all the junk files from my iMac so that it can run faster? Its been slowing down ever since I started using it.

    Before doing anything, we might be able to help with your iMac issues here.
    Please download, install and run Etrecheck.
    http://www.etresoft.com/etrecheck
    Copy/paste its report here in another reply thread so that we have a complete profile of your Mac's hardware and installed software.

  • Why is the HTM file of a page saved in FF also being deleted, if one deletes the subfolder with the corresponding files?

    Alright, let me explain: When I'm saving a web page in FF, this will create a .HTM file as well as a subdirectory with matching filename plus suffix "-Dateien" (German version - I'd guess in the English version it would probably be "-files" or maybe "-data" instead...). Anyway, now if I delete that subdirectory (including all its content) with the Windows Explorer (I'm still using XP, btw), it'll also delete the corresponding .HTM file in the parent directory. Question is: Why/how does it do that? Could that be some hard or symbolic link phenomenon that escapes me?
    Greetings from Munich & thanks in advance!
    Manfred

    That is a Windows feature called connected files that connects the main file and the folder with the other files for certain file operations and HTML files among others.<br />
    If you delete one of them then the other is deleted automatically (the same for Copy).
    *http://msdn.microsoft.com/en-us/library/windows/desktop/bb776887%28v=vs.85%29.aspx
    *http://www.microsoft.com/mspress/books/sampchap/6232.aspx
    You can use the registry editor (regedit.exe) to create a NoFileFolderConnection key of type REG DWORD and set the value to 0x01 to disable this "Manipulate connected files as a unit" feature.
    *HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\NoFileFolderConnection: REG_DWORD 0x01
    Change the value to 0x00 to re enable.
    See also "Operations on an HTML file or folder apply to similarly named folder or HTML file":
    *http://support.microsoft.com/kb/252721

  • I am able to 'create a new version from original' but when I try to export the original, I only get a .jpg with the XMP file. The original is obviously there but why can't I access it please?

    In Aperture 3 when I right click on an image I am able to 'create new version from original' which suggests that the original is there. When I try to export the original I only get a .jpg with the XMP file. These particular images are from 2010, has the RAW file become disconnected somehow? Please, how do I get access to the RAW file for editing in Ps? Thank you. Thomasrevil.

    Sorry leonie, 'Use RAW as Original' is not an option for the image shot with the Canon.
    Then your Import settings must have been different, when you imported the Canon photos.
    You can check, if there is still a hidden raw file somewhere. If the image has been imported as a pair, you should see the "J" badge in Browser and Viewer, if you enable badge overlays. This indicates a pair, with the jpeg as original.
    Select one of those images, and then relocate the original files "File > Relocate original" to a folder, where you can inspect it. Use "File > Show in Finder" after ward. Look, don't touch .
    Then put it back, using "File > Consolidate".
    Do you see your raw files in the folder, or is only a jpeg there?

Maybe you are looking for

  • Executing a Variable in a Stored Procedure containing an Update Statement

    Hi, I have created a Stored Procedure, it has one input parameter. Inside the Stored Procedure there are 5 other variables are declared, based on the input parameter 4 of these variables are populated. Fifth variable is a a concatenation of text and

  • Error creating appsutil.zip on RHEL5

    Hi all, I want to configure autoconfig follow link : http://www.in-oracle.com/Oracle-Apps/11i/migrate-autoconfig-DB.php but I have a problem when create appsutil.zip file. when i run "$perl $AD_TOP/bin/admkappsutil.pl" i got this error "environment n

  • BI Publisher Metadata

    I am trying to refresh the BI Publisher Metadata but doesn't seem to work. I have added new columns to the business and presentation layer of the rpd and saved it. I could load the "BI Presentation Services" metadata with out any issues, but BI Publi

  • How can I Filter AMF Data to CFC?

    How can I keep Flex from sending certian properties thru a remoteobject to a cfc function? I have a class that has a large XML variable that I don't want being sent to my cfc? How can I exclude it?

  • Macbook Pro Retina display 15 inch airplay mirroring doesn't work, what can i do?

    I have this Mac since 1 month ago, 2 weeks ago the airplay mirroring was ok, but right now it doesn't work. Please help me.