Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

About Folder object path

New Here ,
Mar 01, 2008 Mar 01, 2008
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.
TOPICS
Scripting
495
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Mar 02, 2008 Mar 02, 2008
Hi Avi,

Here is an example:

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

Kasyan
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 02, 2008 Mar 02, 2008
LATEST
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;
alert(amit);
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,
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines