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.

Similar Messages

  • Need Help With Simple ABAP Code

    Hello,
    I'm loading data from a DSO (ZDTBMAJ) to an Infocube (ZCBRAD06). I need help with ABAP code to some of the logic in Start Routine. DSO has 2 fields: ZOCTDLINX & ZOCBRDMAJ.
    1. Need to populate ZOCPRODCD & ZOCREFNUM fields in Infocube:
        Logic:-
        Lookup /BI0/PMATERIAL, if /BIC/ZOCBRDMAJ = /BIC/OIZOCBRDMAJ
        then /BIC/ZOCPRODCD = ZOCPRODCD in Infocube
               /BIC/ZOCREFNUM = ZOCREFNUM in Infocube         
    2. Need to populate 0G_CWWTER field in Infocube:
        Logic:
        Lookup /BIC/PZOCTDLINX, if /BIC/ZOCTDLINX = BIC/OIZOCTDLINX
        then G_CWWTER = 0G_CWWTER in Infocube.
    I would need to read single row at a time.
    Thanks!

    I resolved it.

  • Need help creating a folder action for creating folders based on filenames.

    I want to create a folder action that will monitor a folder and every time a file is added to the folder it will create a directory using the filename (minus the extension) and move the file the that directory

    on run {input, parameters} -- create folders from file names and move
      set output to {} -- this will be a list of the moved files
      repeat with anItem in the input -- step through each item in the input
        set {theContainer, theName, theExtension} to (getTheNames from anItem)
        try
          set destination to (makeNewFolder for theName at theContainer)
          tell application "Finder"
            move anItem to destination
            set the end of the output to the result as alias -- success
          end tell
        on error errorMessage -- duplicate name, permissions, etc
          log errorMessage
          # handle errors if desired - just skip for now
        end try
      end repeat
      return the output -- pass on the results to following actions
    end run
    to getTheNames from someItem -- get a container, name, and extension from a file item
      tell application "System Events" to tell disk item (someItem as text)
        set theContainer to the path of the container
        set {theName, theExtension} to {name, name extension}
      end tell
      if theExtension is not "" then
        set theName to text 1 thru -((count theExtension) + 2) of theName -- just the name part
        set theExtension to "." & theExtension
      end if
      return {theContainer, theName, theExtension}
    end getTheNames
    to makeNewFolder for theChild at theParent -- make a new child folder at the parent location if it doesn't already exist
      set theParent to theParent as text
      if theParent begins with "/" then set theParent to theParent as POSIX file as text
      try
        return (theParent & theChild) as alias
      on error errorMessage -- no folder
        log errorMessage
        tell application "Finder" to make new folder at theParent with properties {name:theChild}
        return the result as alias
      end try
    end makeNewFolder
    This script almost does what I need except for the fact that it screws up on files with periods in them
    for example
    1.2.3.4.txt
    will create the directorys 1, 2, 3, and 4 instead of 1.2.3.4

  • Need help with Quizzes & Advanced Actions

    Hi, I am relatively new to Captivate (v6) and I am looking for a way to force learners to respond to a question BEFORE navigating to the next page.
    On my question slides, I have a submit button and the next page button but no playbar.
    I want the submit button to be active to provide feedback to the question with the next page arrow inactive. It would be great to have a message pop-up (similar to the incomplete message) when the learner presses on the inactive next page button. Once the question has been answered and submitted, then I want the next page arrow to be active for the learner to navigate to the next page.
    Do I need to create an advanced action for this? Either a standard action or conditional?
    Can anyone help me with this? I would be most appreciative!

    Normally they do not need the Next button, except during Review (if you'll allow that after the last Quiz attempt).
    So my most simple solution is to drag the Next button under the Clear button, it is normally stacked lower so it will be hidden. During Review, the Clear button will not be there and the Next button will become visible.
    Have a look at my blog posts about functionality of Question slides:
    http://lilybiri.posterous.com/question-question-slides-in-captivate
    http://lilybiri.posterous.com/question-question-slides-part-2
    Lilybiri

  • Need help with simple XML validation

    I am new to Spry and need some help creating a simple
    validation. There is a form field which must not contain a value
    already in the database. I have a script which accepts a parameter
    and returns a boolean result. Here is the XML:
    <samples>
    <sample>
    <ISFOUND>0</ISFOUND>
    </sample>
    </samples>
    1. How do I call this script when the form field changes and
    pass the form value as the parameter?
    2. How do I check the returned value in the XML and throw an
    error if true?
    I appreciate any help with this. Please let me know if there
    is a better way to achieve the same result.
    Thanks,
    Rich

    I enabled the call to the XML response. However, I am having
    trouble identifying when the call is complete so I can parse the
    result. How do I run my check after the data load and display the
    proper message?

  • IDSC3 Print Booklet Troubles (need help with Teus's rotatepages.js script)

    Hi all,
    I've been reading the original Nov '05 thread on this (http://www.adobeforums.com/webx/.3bbd4bb6/17) but I'm having trouble with the script provided.
    Very briefly, I'm trying to make a 16-page catalog on letter-sized paper, using half-size 8.5x5.5 pages in landscape format. I did a considerate amount of work on the layout thinking I wouldn't have any problems later on, but when I had a look at the Preview in the Print Booklet setting I completely freaked out -- the Preview builds with the bottom half of each landscaped half-page to the right side of the page!
    Based on what I've read so far, the script provided in the earlier thread should be the answer to my headache. But when I run it as directed, I get this Javascript error:
    Error number: 21
    Error string: Undefined is not an object
    Line: 42
    Source: pdfpage.parent.rotate(90, Anchorpoint.topLeftAnchor)
    This is my first time dabbling with scripts, so this error message dumbfounds me.
    Help!
    Edo Mor

    It should work, I think, if you make a folder inside the scripts folder called "Version 4.0 Scripts" (without the quotes) and put it in that.
    Peter

  • Beginner needs help with simple code.

    I just statrted learnind java, and I need some help with this simple program. For some reason everytime I enter my Farenheit value, the Celsius conversion returns as 0.0. Would really appreciate the help. Thanks.
    Here's the code:
    public class TempConverter
    public static void main(String[] args)
    double F = Double.parseDouble(args[0]);
    System.out.println("Temperature in Farenheit is: " + F);
    double C = 5 / 9;
    C *= (F - 32);
    System.out.println("Temperature in Celsius is: " + C);
    }

    double C = 5 / 9This considers "5" and "9" to be integers and does an integer division, discarding the remainder. The result of that division is 0. Trydouble C = 5.0/9.0;

  • Need Help with Advanced Button Actions

    I am a brand new Captivate 5 user and I have created a image button that I want to have a double action. When the user clicks on the image button, I want it to SHOW a new button AND SHOW another image. I used the Advanced Actions but it does not work when I preview project.  Help!

    Hello and welcome to the forum,
    Did you assign the advanced action to the image button as Success action? And the new button + the image have to be on the same slide, but with the status Invisible. You can not show hidden objects that are sitting on another slide then the slide with the advanced action.
    If you want to have more information about advanced actions, I do blog a lot about them. Here is the link to my blog:
    http://lilybiri.posterous.com
    Lilybiri

  • Need Help with simple array program!

    Hi, I have just recently started how to use arrays[] in Java and I'm a bit confused and need help designing a program.
    What this program does, it reads in a range of letters specified by the user. The user then enters the letters (a, b or c) and stores these characters into an array, which the array's length is equal to the input range the user would enter at the start of the program. The program is then meant to find how many times (a,b and c) appears in the array and the Index it first appears at, then prints these results.
    Here is my Code for the program, hopefully this would make sense of what my program is suppose to do.
    import B102.*;
    class Letters
         static int GetSize()
              int size = 0;
              boolean err = true;
              while(err == true)
                   Screen.out.println("How Many Letters would you like to read in?");
                   size = Keybd.in.readInt();
                   err = Keybd.in.fail();
                   Keybd.in.clearError();
                   if(size <= 0)
                        err = true;
                        Screen.out.println("Invalid Input");
              return(size);
         static char[] ReadInput(int size)
              char input;
              char[] letter = new char[size];
              for(int start = 1; start <= size; start++)
                   System.out.println("Please enter a letter (a, b or c) ("+size+" max), enter # to stop:");
                   input = Keybd.in.readChar();
                   while((input != 'a') && (input != 'b') && (input != 'c') && (input != '#'))
                        Screen.out.println("Invalid Input");
                        System.out.println("Please enter a letter (a, b or c) ("+size+" max, enter # to stop:");
                        input = Keybd.in.readChar();
                                    while(input == '#')
                                                 start == size;
                                                 break;
                   for(int i = 0; i < letter.length; i++)
                        letter[i] = input;
              return(letter);
         static int CountA(char[] letter)
              int acount = 0;
              for(int i = 0; i < letter.length; i++)
                   if(letter[i] == 'a')
                        acount++;
              return(acount);
         static int CountB(char[] letter)
              int bcount = 0;
              for(int i = 0; i < letter.length; i++)
                   if(letter[i] == 'b')
                        bcount++;
              return(bcount);
         static int CountC(char[] letter)
              int ccount = 0;
              for(int i = 0; i < letter.length; i++)
                   if(letter[i] == 'c')
                        ccount++;
              return(ccount);
         static int SearchA(char[] letter)
              int ia;
              for(ia = 0; ia < letter.length; ia++)
                   if(letter[ia] == 'a')
                        return(ia);
              return(ia);
         static int SearchB(char[] letter)
              int ib;
              for(ib = 0; ib < letter.length; ib++)
                   if(letter[ib] == 'b')
                        return(ib);
              return(ib);
         static int SearchC(char[] letter)
              int ic;
              for(ic = 0; ic < letter.length; ic++)
                   if(letter[ic] == 'c')
                        return(ic);
              return(ic);
         static void PrintResult(char[] letter, int acount, int bcount, int ccount, int ia, int ib, int ic)
              if(ia <= 1)
                   System.out.println("There are "+acount+" a's found, first appearing at index "+ia);
              else
                   System.out.println("There are no a's found");
              if(ib <= 1)
                   System.out.println("There are "+bcount+" b's found, first appearing at index "+ib);
              else
                   System.out.println("There are no b's found");
              if(ic <= 1)
                   System.out.println("There are "+ccount+" c's found, first appearing at index "+ic);
              else
                   System.out.println("There are no c's found");
              return;
         public static void main(String args[])
              int size;
              char[] letter;
              int acount;
              int bcount;
              int ccount;
              int ia;
              int ib;
              int ic;
              size = GetSize();
              letter = ReadInput(size);
              acount = CountA(letter);
              bcount = CountB(letter);
              ccount = CountC(letter);
              ia = SearchA(letter);
              ib = SearchB(letter);
              ic = SearchC(letter);
              PrintResult(letter, acount, bcount, ccount, ia, ib, ic);
              return;
    }     Some errors i get with my program are:
    When reading in the letters to store into the array, I get the last letter I entered placed into the entire array. Also I believe my code to find the Index is incorrect.
    Example Testing: How many letters would you like to read? 3
    Enter letter (a, b or c) (# to quit): a
    Enter letter (a, b or c) (# to quit): b
    Enter letter (a, b or c) (# to quit): c
    It prints "There are no a's'" (there should be 1 a at index 0)
    "There are no b's" (there should be 1 b at index 1)
    and "There are 3 c's, first appearing at index 0" ( there should be 1 c at index 2)
    The last thing is that my code for when the user enters "#" that the input of letters would stop and the program would then continue over to the counting and searching part for the letters, my I believe is correct but I get the same problem as stated above where the program takes the character "#" and stores it into the entire array.
    Example Testing:How many letters would you like to read? 3
    Enter letter (a, b or c) (# to quit): a
    Enter letter (a, b or c) (# to quit): #
    It prints "There are no a's'" (should have been 1 a at index 0)
    "There are no b's"
    and "There are no c's"
    Can someone please help me??? or does anyone have a program simular to this they have done and would'nt mind showing me how it works?
    Thanks
    lou87.

    Without thinking too much...something like this
    for(int start = 0; start < size; start++) {
                System.out.println("Please enter a letter (a, b or c) ("+size+" max), enter # to stop:");
                input = Keybd.in.readChar();
                while((input != 'a') && (input != 'b') && (input != 'c') && (input != '#')) {
                    Screen.out.println("Invalid Input");
                    System.out.println("Please enter a letter (a, b or c) ("+size+" max, enter # to stop:");
                    input = Keybd.in.readChar();
                if(input == '#') {
                        break;
                letter[start] = input;
            }you dont even need to do start = size; coz with the break you go out of the for loop.

  • I need help with simple problems. im a student.

    i'd like to be advanced with my studies so i will post questions.. i need help on how to answer. thank you.
    1. create a java program that will evaluate if the value entered is a positive, negative, vowel, consonant and special characters.
    im actually done with the positive and negative using if else statements.. i used an integer data type. now my question is how do conjoin the characters when i need to evaluate a vowel and a consonant. i cant use char either. please help. i dont know what to do yet.
    2. create java program that will translate the input from numbers to words. e.g. input:123 output: one hundred twenty-three.
    i have an idea to use a switch case statement. but i have no idea on how will i be able to do it. so if you guys can help me.. well then thankies..

    Welcome to the Sun forums. First, please note that you have posted in the wrong forum. This forum is for topics related to Sun's JavaHelp product. You should post your questions in the New to Java forum.
    As part of your learning, you will have to develop the ability to select an approach to a problem, create a design that reflects that approach, and then implement the design with code that you create.
    So, it's inappropriate for us to take the problem statement that you have been given and short-circuit your learning process by giving you the implemented problem solution. We can comment on the individual questions that you may have, and point out problems and errors that we see in the code that you develop.
    As a hint, when you are stuck, forget about Java and programming. Just start with a sheet of paper and a pencil, and figure out how to layout the task on paper. The consider how to translate that to programming.
    If you have problems, post short example code that shows the problem, and explain your question clearly. We can't read minds.
    Make sure you post code correctly so that it's not mangled by the forum software, and so that formatting is maintained. Select your typed or pasted code block and press the CODE button above the typing area.

  • Need help with simple python script (renaming and moving folder)

    I have this script for use with sabnzbd, what it does is rename all folders in the desired directory, replacing any spaces with dots (example: Movie 2011 HD -> Movie.2011.HD).
    #!/usr/bin/env python2
    workdir = '/media/stuff/movies' #### CHANGE this line to your movie directory
    for path, dirnames, filenames in os.walk(workdir):
    print "path:", path
    for dirname in dirnames:
    if dirname.find(' ') > -1 :
    # Yes, a space in the directory name, so replace it:
    newname = dirname.replace(' ','.')
    fulldirname = path + '/' + dirname
    fullnewname = path + '/' + newname
    print "Rename" , fulldirname, " ", fullnewname
    os.rename(fulldirname, fullnewname)
    What I would like it to do is 1. rename only the movie I run the script on (instead of /media/stuff/movies as above, the entire movie folder), and then 2. move the movie into /media/stuff/movies. Or vice versa! (I'd just prefer not to have it run on the entire movie directory).
    Appreciate any help!

    Just my two cents:
    I would not use walkdir but as usual a combination of find and python.
    A simplified version of the script could look like this:
    #!/usr/bin/python
    # -*- coding: utf8 -*-
    import os, shutil
    # Define target dir
    target_dir = "/media/stuff/movies/"
    # Loop through all found files
    for source_file in os.popen ("find ."):
    # Remove \n
    source_file = source_file[:-1]
    extension = source_file[-3:]
    # Only process video files
    if (extension == 'mkv') or (extension == 'avi') or (extension == 'mp4'):
    target_file = source_file.split('/')
    target = target_file[len(target_file)-1]
    target = target.replace(' ','.')
    shutil.copy (source_file, targetdir + target)
    Of course you might first want to print out instead of really copy files.

  • Flash Newbie needs help with Movie Clips/Action Scripting

    Hi -
    I'm having a problem with my movie clips playing
    simultaneously and cannot, for the life of me, figure out what I
    have done wrong. I'm new to flash, so I may have set something up
    incorrectly, but here's what I have so far:
    11 layers, total: 1 layer with 10 control buttons, each
    button with the following actionscript:
    on (release) {
    gotoAndPlay(85);
    Where the number changes in relation to which keyframe the
    next movie is on.
    I have 10 movies, total, but they are only movie clips,
    essentially photo slide shows with audio, made all in the library.
    The problem happens when I click on the second or third
    button. Not only does the movie that I have selected begin to play,
    but all of the previous clips do as well, so it all sounds quite
    garbled. I don't know what I am missing in the action script, as my
    Action Layer has a stop command on it at each keyframe where there
    is a new clip to play.
    I have tried to add a stopAllSounds command, but I'm afraid
    that doesn't do anything because it is not a "sound file" per se,
    playing in the timeline.
    I'm at the end of my rope and really need some help in
    figuring this one out. My project is hanging in the balance on
    this, as I have scripted everything else correctly and it runs
    beautifully.
    Please help!
    Thanks,
    Caroline

    Each layer has a blank keyframe before and after each
    movieclip. Each movie clip is at a different frame. Even with the
    blank keyframes added, the second video starts to play and then the
    first video begins to play. Same happens if I click on the third
    button. Third plays, and starts 1st and 2nd shortly thereafter. Is
    there an action script I can put in that will tell the timeline
    that, when a button is clicked, no matter where the movieclip is,
    it will stop and start the newly selected movieclip?

  • Need help with simple Quicktime 8 Batch Save As Mov script

    I'm new with AppleScript and would like to create a simple script that will take MEPG, AVI, and other video files and wrap them as an MOV file. I thought I used to have a script that would allow me to drop multiple files or folders onto it and it would batch "save as" to the MOV container. Any help is appreciated!
    Thanks,
    Eric

    Hi,
    See these:
    http://stackoverflow.com/questions/11690142/how-to-call-a-vbscript-from-a-batch-file-without-opening-an-additional-command-p
    http://stackoverflow.com/questions/11899730/running-vbscript-from-batch-file
    Don't retire TechNet! -
    (Don't give up yet - 13,225+ strong and growing)

  • [SOLVED] Need help with simple a script.

    Hello, Iam searching for a small script that sorts my folders in alphabetical order.
    I want the script to create folder from A to Z and then move every folder that begins with A into the A folder etc etc..
    I really hope anyone understands what im searching for here.
    Last edited by nikihr (2009-09-01 20:25:33)

    scragar wrote:
    brisbin33 wrote:
    be careful, mv $I* will pick up your freshly created directory too;
    i'd `mkdir ./sorted/$I` instead, then `mv ./sorted/* ./ && rm -r ./sorted` at the end.
    you could also use
    find ./ -maxdepth 1 -iname "$I*" -exec mv {} ./sorted/ \;
    to do the actual move*
    *note: untested .
    While my `mv` code will throw an error the error will not stop the moving of the files, you'll just get 26 messages about being unable to move the directory to itself. I could probably find a way to avoid this that doesn't require the use of find(which I personally dislike) or a second dir, probably just using a file prefix like "_" or something. It would only be a small edit:
    #!/bin/bash
    for I in {a..z}; do
    echo "Moving $I";
    mkdir "_$I";
    echo "mv $I* \"$(echo $I | tr [:lower:] [:upper:])\"* _$I/";
    # mv $I* "$(echo $I | tr [:lower:] [:upper:])"* "_$I/";
    mv "_$I" $I
    done
    well, i have to politely disagree:  one, invoking find once is much better IMHO than mv with tr in a subshell.  and two, my ./sorted/ idea adds one additional mv command and one additional rm command where you're _$I suggestion added 26 additional mv commands....  just sayin'
    but we could also paint the bikeshed blue. .
    anyways, i think the OP's got more than he bargained for, hopefully we'll see a [SOLVED] on this one soon.

  • Need help with simple file sharing application

    I have an assignment to build a Java File Sharing application. Since I'm relatively new to programming, this is not gonna be an easy task for me.
    Therefore I was wondering if there are people willing to help me in the next few days. I will ask questions in this thread, there will be loads of them.
    I already have something done but I'm not nearly halfway finished.
    Is there a code example of a simple file sharing application somewhere? I didn't manage to find it.
    More-less, this is what it needs to contain:
    -client/server communication (almost over)
    -file sending (upload, download)
    -file search function (almost over)
    -GUI of an application.
    GUI is something I will do at the end, hopefully.
    I hope someone will help me. Cheers
    One more thing, I'm not asking for anyone to do my homework. I will only be needing some help in the various steps of building an application.
    As I said code examples are most welcome.
    This is what I have done so far
    Server:
    package ToJeTo;
    import java.io.*;
    import java.net.*;
    public class MultiServer {
        public static ServerSocket serverskiSoket;
        public static int PORT = 1233;
        public static void main(String[] args) throws IOException {
            try {
                serverskiSoket = new ServerSocket(PORT);
            }catch (IOException e) {
                System.out.println("Connection impossible");
                System.exit(1);
            do {
                Socket client = serverskiSoket.accept();
                System.out.println("accepted");
                ClientHandler handler = new ClientHandler(client);
                handler.start();
            } while(true);
    }Client:
    package ToJeTo;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.net.*;
    import java.util.Scanner;
    public class MultiClient {
        public static InetAddress host;
        public static int PORT = 1233;
        public static void main(String[] args) {
            try {
                host = InetAddress.getLocalHost();
            }catch (UnknownHostException uhe) {
                System.out.println("Error!");
                System.exit(1);
            sendMessages();
        private static void sendMessages() {
            Socket soket = null;
            try {
                soket = new Socket(host, PORT);
                Scanner networkInput = new Scanner(soket.getInputStream());
                PrintWriter networkOutput = new PrintWriter(soket.getOutputStream(), true);
                Scanner unos = new Scanner(System.in);
                String message, response;
                do {
                    System.out.println("Enter message");
                    message = unos.nextLine();
                    networkOutput.println(message);
                    response = networkInput.nextLine();
                    System.out.println("Server: " + response);
                }while (!message.equals("QUIT"));
            } catch (IOException e) {
                e.printStackTrace();
            finally {
                try{
                    System.out.println("Closing..");
                    soket.close();
                } catch (IOException e) {
                    System.out.println("Impossible to disconnect!");
                    System.exit(1);
    }ClientHandler:
    package ToJeTo;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class ClientHandler extends Thread {
        private Socket client;
        private Scanner input;
        private PrintWriter output;
        public ClientHandler(Socket serverskiSoket) {
            client = serverskiSoket;
            try {
            input = new Scanner(client.getInputStream());
            output = new PrintWriter(client.getOutputStream(), true);
            } catch (IOException e) {
                e.printStackTrace();
            public void run() {
                String received;
                do {
                received = input.nextLine();
                output.println("Reply: " + received);
                } while (!received.equals("QUIT"));
                try {
                    if (client != null)
                        System.out.println("Closing the connection...");
                        client.close();
                }catch (IOException e) {
                    System.out.println("Error!");
    }Those three classes are simple client server multi-threaded connection.

    Now the other part that contains the search function looks like this:
    package ToJeTo;
    import java.io.*;
    import java.util.*;
    public class User {
        String nickname;
        String ipAddress;
        static ArrayList<String> listOfFiles = new ArrayList<String>();
        File sharedFolder;
        String fileLocation;
        public User(String nickname, String ipAddress, String fileLocation) {
            this.nickname = nickname.toLowerCase();
            this.ipAddress = ipAddress;
            sharedFolder = new File(fileLocation);
            File[] files = sharedFolder.listFiles();
            for (int i = 0; i < files.length; i++) {
                listOfFiles.add(i, files.toString().substring(fileLocation.length()+1));
    public static void showTheList() {
    for (int i = 0; i < listOfFiles.size(); i++) {
    System.out.println(listOfFiles.get(i).toString());
    @Override
    public String toString() {
    return nickname + " " + ipAddress;
    User Manager:
    package ToJeTo;
    import java.io.*;
    import java.util.*;
    class UserManager {
        static ArrayList<User> allTheUsers = new ArrayList<User>();;
        public static void addUser(User newUser) {
            allTheUsers.add(newUser);
        public static void showAndStoreTheListOfUsers() throws FileNotFoundException, IOException {
            BufferedWriter out = new BufferedWriter(new FileWriter("List Of Users.txt"));
            for (int i = 0; i < allTheUsers.size(); i++) {
                    System.out.println(allTheUsers.get(i));
                    out.write(allTheUsers.get(i).toString());
                    out.newLine();
            out.close();
    }Request For File
    package ToJeTo;
    import java.util.*;
    public class RequestForFile {
        static ArrayList<String> listOfUsersWithFile = new ArrayList<String>();
        Scanner input;
        String fileName;
        public RequestForFile() {
            System.out.println("Type the wanted filename here: ");
            input = new Scanner(System.in);
            fileName = input.nextLine();
            for (User u : UserManager.allTheUsers) {
                for (String str : User.listOfFiles) {
                    if (str.equalsIgnoreCase(fileName))
                        listOfUsersWithFile.add(u.nickname);
        public RequestForFile(String fileName) {
            for (User u : UserManager.allTheUsers) {
                for (String str : User.listOfFiles) {
                    if (str.equalsIgnoreCase(fileName))
                        listOfUsersWithFile.add(u.nickname);
        public static List<String> getAll() {
            for (int i = 0; i < listOfUsersWithFile.size(); i++) {
                //System.out.println("User that has the file: " + listOfUsersWithFile.get(i));
            return listOfUsersWithFile;
    }Now this is the general idea.
    The user logs in with his nickname and ip address. He defines his own shared folder and makes it available for other users that log on to server.
    Now each user has their own list of files from a shared folder. It's an ArrayList.
    User manager class is there to store another list, a list of users that are connected with server.
    When the user is searching for a particular file, he is searching through all the users and their respective files lists. Therefore for each loop inside a for each loop.
    Now the problem is how to connect all that with Client and Server class and put it into one piece.
    GUI should look somewhat like this:

Maybe you are looking for

  • Stuckup in search help FM!!

    hi experts.... I have a simple report, where i need to populate search help. the below is the coding wat i have used, but fetching a error. pls help me out, Thnx alot . if u want to see the entire coding too i will send... Regards Rachel. seLECTION-S

  • Error Message: No applications are set up or enabled for synchronization - BlackBerry Pearl 8130

    The desktop software is not registering or recognizing my organizer sync settings.  Each time I make my selections, the software confirms that I have sucessfully confirgured the product.  When I select "Finish", the settings do not seem to be saved a

  • AU not showing up in Logic or in AU manager

    Ok, I have recently re purchased Steinbergs Virtual Guitarist 2 not that there is a UB update for my intel mac. I've done a fresh install and uninstall three times, follwed everything to a T. As the player works fine as a stand alone Steinberg tell m

  • Menu bar shows twice on dual monitor, dock moves around

    Mac Pro (early 2008) w/ Yosemite and dual monitor display The menu bar at the top of the screen appears on BOTH monitors ALL the time. However, the one on the secondary monitor is dimmed out, and can be two or three app switches behind. For example,

  • Security settings won't let JavaScript even open a document?

    Yes, I know this question has been covered a hundred times or more in this forum.  I'm also very sorry for adding to the list of people who don't understand it, but-  Well, I don't understand it. I'm very familiar with JavaScript and ExtendScript.  I