Jump to content

ABA3D

Members
  • Content Count

    9
  • Joined

  • Last visited

Community Reputation

0 Neutral

About ABA3D

  • Rank
    Newbie
  1. Hi I found simple script that uses InternetExplorer.Application fileDialog but its in VBscript :(can u help me to convert it to javascript?!here is the code: Option ExplicitWScript.Echo "Selected file: " & ChooseFile( )Function ChooseFile( )' Select File dialog based on a script by Mayayana' Known issues:' * Tree view always opens Desktop folder' * In Win7/IE8 only the file NAME is returned correctly, the path returned will always be C:\fakepath\' * If a shortcut to a file is selected, the name of that FILE will be returned, not the shortcut's On Error Resume Next Dim objIE, strSelected ChooseFile = "" Set objIE = CreateObject( "InternetExplorer.Application" ) objIE.visible = False objIE.Navigate( "about:blank" ) Do Until objIE.ReadyState = 4 Loop objIE.Document.Write "<HTML><BODY><INPUT ID=""FileSelect"" NAME=""FileSelect"" TYPE=""file""><BODY></HTML>" With objIE.Document.all.FileSelect .focus .click strSelected = .value End With objIE.Quit Set objIE = Nothing ChooseFile = strSelectedEnd Function thanks for ur help
  2. Hi I found simple script that uses InternetExplorer.Application fileDialog but its in VBscript :(can u help me to convert it to javascript?! here is the code: Option ExplicitWScript.Echo "Selected file: " & ChooseFile( )Function ChooseFile( )' Select File dialog based on a script by Mayayana' Known issues:' * Tree view always opens Desktop folder' * In Win7/IE8 only the file NAME is returned correctly, the path returned will always be C:\fakepath\' * If a shortcut to a file is selected, the name of that FILE will be returned, not the shortcut's On Error Resume Next Dim objIE, strSelected ChooseFile = "" Set objIE = CreateObject( "InternetExplorer.Application" ) objIE.visible = False objIE.Navigate( "about:blank" ) Do Until objIE.ReadyState = 4 Loop objIE.Document.Write "<HTML><BODY><INPUT ID=""FileSelect"" NAME=""FileSelect"" TYPE=""file""><BODY></HTML>" With objIE.Document.all.FileSelect .focus .click strSelected = .value End With objIE.Quit Set objIE = Nothing ChooseFile = strSelectedEnd Function thanks for ur help
  3. Hi I have this script that supposed to show me the path of the selected file but it shows me an error that says "Unspecified error."the error shows up in the error console and referrs to line 5.it shows up in the error console.it shows up in the error console.it shows up in the error console.it shows up in the error console.it shows up in the error console.it shows up in the error console.it shows up in the error console.it shows up in the error console.here is the code: function SelectFile(){var objShell = new ActiveXObject("Shell.Application"); var objFolder; objFolder = objShell.BrowseForFolder(0, "Open File", 16384); if (objFolder != null) { var oFolderItem = objFolder.Items().item(); document.getElementById("fileNameS").value=oFolderItem.Path; }} Im using IE and wraping it with HTA.thanks for ur help
  4. yes it referrs to line 5 objFolder = objShell.BrowseForFolder(0, "Open File", 16384); it shows up in the error console.yes Im using IE Im wraping it with HTA.
  5. Hi I have this script that supposed to show me the path of the selected file but it shows me an error that says "Unspecified error." here is the code: function SelectFile(){var objShell = new ActiveXObject("Shell.Application"); var objFolder; objFolder = objShell.BrowseForFolder(0, "Open File", 16384); if (objFolder != null) { var oFolderItem = objFolder.Items().item() document.getElementById("fileNameS").value=oFolderItem.Path; }} thanks for ur help
  6. Never mind I solved it and yes u can do that in JavaScript.
  7. hi Im writing a small app to my workplace and its using the WMI.I need it to run the notepad or any other app in hidden mode, so I found this script on the net but its in VBS. can anyone help me to convert it to javascript? here is the code: Const SW_SHOW = 12Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")Set objSWbemServices = objSwbemLocator.ConnectServer(".","root\cimv2")Set oStartup = objSWbemServices.Get("Win32_ProcessStartup")Set oConfig = oStartup.SpawnInstance_oConfig.ShowWindow = SW_SHOWSet objCreateProc = objSWbemServices.Get("Win32_Process")int errReturn = objCreateProc.Create("notepad.exe",Null,oConfig,intProcID) thank u all for ur help
  8. thanks for the replay but i meant that i need to display the first file name of the sequences for example lets say that i have a files sequence called: color.001.sgicolor.002.sgicolor.003.sgi shadow.001.sgishadow.002.sgishadow.003.sgi thats what the script is doing right now it displays all the sequences but what i need is to display only the first file of each sequence for exemple: color.001.sgishadow.001.sgi thanks for the help
  9. hi im writing an app with javascript fso to display a file sequence in a list but im having a problem with the display it displays the whole sequence or the second file insted the first file of the sequence .here is the code: function loadRenderFolders(){var FSO = new ActiveXObject("Scripting.FileSystemObject");var Stable = "";var Etable = "";var Str = "";var Etr = "";var s="";var abc = new Array();var i=0; var f = FSO.GetFolder("Render\\images\\Sh02\\v_03\\");var enumtor = new Enumerator(f.Files); Stable = "<table cellpadding=0 cellspacing=0 border=0>"; for (; !enumtor.atEnd(); enumtor.moveNext()) { var name = enumtor.item().Name; abc[i]=name; i++; s += "<tr><td nowrap style=\"width:320; height:40; font-size:20; font-family:Calibri; color:#FFFFFF;\" onMouseOver=\"this.style.background='#1f1c29';\" onMouseOut=\"this.style.background='';\"> "+abc[0]+"</td></tr>"; }Etable = "</table>";renderList.innerHTML=Stable+s+Etable;}
×
×
  • Create New...