2 Replies Latest reply on Mar 2, 2008 3:10 PM by (Avi)

    About Folder object path

      Hello ,

      My name is Avi. I want to create a folder on desktop for mac as well for windows. I want to create this folder using javascript. I am using cs3.

      When anybody try to run this script on any operating system the folder will be create on desktop or any where as per users requirement.

      Is there any logic between paths of mac osx and windows directory. Using that i can create a folder on any operating system.

      I want to create a single script which can use for both operating system.

      I knew how to create a folder using FILE SYSTEM ACCESS

      create a folder object(folderobj)
      To create a folder use folderobj.create().

      Is this information sufficient to understand my problem or i need to explain it more.

      Thank you for your co-operation.
        • 1. Re: About Folder object path
          Kasyan Servetsky Level 5
          Hi Avi,

          Here is an example:

          var myFolder = new Folder ("~/Desktop/My New Folder");
          if (myFolder.exists == false){
          else {
          alert("Folder \"My New Folder\" already exists.");

          • 2. Re: About Folder object path
            Level 1
            Thank you Kasyan.
            I have one more question for you.
            I created a edittext field using scriptUI and i want to get the data from that textfield.
            I use variable editcontets to get the data but in this case it not working. I am posting my script. Please let me know if there is any thing wrong i am doing.

            var g3 = myDlg.msgPnl1.add( "group" );
            myDlg.msgPnl1.titleSt = g3.add('statictext', undefined, 'Name: ');
            myDlg.msgPnl1.titleEt = g3.add('edittext', undefined,'Test');
            var amit = myDlg.msgPnl1.titleEt.editContents;
            myDlg.msgPnl1.create = g3.add('button', undefined, 'Create');
            myDlg.msgPnl1.titleSt = g3.add('statictext', undefined, ' ');

            when you run the script whatevery data in that text field will come o the variable amit.
            When i am trying to run this script i am getting alert as "undefined".
            I do not why please help me in this matter as well.

            Thank you,