cedrIck Posted March 5, 2007 Share Posted March 5, 2007 Hello there, upon the FileSaveDialog command, is there anyway for the directory to select?..like i don't wan to juz select the desktop or my documents..what i want is to select inside folders and inside folders..for example.. Desktop > My Documents > Folder 1 > Folder 2 > Folder 3.. I want the computer to automatically select the sub folder itself..so that it can save in the correct folder..is there anyway i can do it??..please help..thanks.. =) Link to comment Share on other sites More sharing options...
jvanegmond Posted March 5, 2007 Share Posted March 5, 2007 FileSelectFolder? github.com/jvanegmond Link to comment Share on other sites More sharing options...
cedrIck Posted March 5, 2007 Author Share Posted March 5, 2007 FileSelectFolder?Erm..sorry..can u teach me an example of FileSelect Folder?..i'am quite new to this software. The help examples in AutoIT i don't quite understand.. thanks.. =) Link to comment Share on other sites More sharing options...
jvanegmond Posted March 5, 2007 Share Posted March 5, 2007 I agree, the help file is unclear here. $Dir = FileSelectFolder("Select a directory","") If @error Then Exit MsgBox(0, "Chosen directory", $Dir) github.com/jvanegmond Link to comment Share on other sites More sharing options...
BrettF Posted March 5, 2007 Share Posted March 5, 2007 Erm..sorry..can u teach me an example of FileSelect Folder?..i'am quite new to this software. The help examples in AutoIT i don't quite understand.. thanks.. =) $dir = FileSelectFolder("Choose a folder.", "") MsgBox (0, "Chosen Dir", "Your Chosen Dir was: " & $dir) Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
cedrIck Posted March 5, 2007 Author Share Posted March 5, 2007 Sorry..what i meant was like this...for example.if i were to save a file using notepad then i want to select this Folder 3 particulary Desktop > My Documents > Folder 1 > Folder 2 > Folder 3 so that i can save under this folder..this text file to save under folder 3..so how do i get the computer to automically select this Folder 3 so that i can save my text file in it. I dun quite understand ur example..really sorry abt that..hope u can help me furthur more.thanks. =) Link to comment Share on other sites More sharing options...
BrettF Posted March 5, 2007 Share Posted March 5, 2007 Sorry..what i meant was like this...for example.if i were to save a file using notepad then i want to select this Folder 3 particulary Desktop > My Documents > Folder 1 > Folder 2 > Folder 3 so that i can save under this folder..this text file to save under folder 3..so how do i get the computer to automically select this Folder 3 so that i can save my text file in it. I dun quite understand ur example..really sorry abt that..hope u can help me furthur more.thanks. =) Like This? $IntDir = "" $dir = FileSaveDialog("Save", $IntDir, "Text Files (.txt)") & ".txt" MsgBox(0, "Chosen Dir", "Your first Chosen Dir was: " & $dir) $IntDir = $dir $dir2 = FileSaveDialog("Save", $IntDir, "Text Files (.txt)") & ".txt" MsgBox(0, "Chosen Dir", "Your first Chosen Dir was: " & $dir2) FileDelete($dir) FileDelete($dir2) Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
cedrIck Posted March 5, 2007 Author Share Posted March 5, 2007 Sorry..what i meant was like this...for example.if i were to save a file using notepad then i want to select this Folder 3 particulary Desktop > My Documents > Folder 1 > Folder 2 > Folder 3 so that i can save under this folder..this text file to save under folder 3..so how do i get the computer to automically select this Folder 3 so that i can save my text file in it. I dun quite understand ur example..really sorry abt that..hope u can help me furthur more.thanks. =)A little help here will do..thanks..the help examples in AutoIT cannot help me..=) Link to comment Share on other sites More sharing options...
BrettF Posted March 5, 2007 Share Posted March 5, 2007 Like This? $IntDir = "" $dir = FileSaveDialog("Save", $IntDir, "Text Files (.txt)") & ".txt" MsgBox(0, "Chosen Dir", "Your first Chosen Dir was: " & $dir) $IntDir = $dir $dir2 = FileSaveDialog("Save", $IntDir, "Text Files (.txt)") & ".txt" MsgBox(0, "Chosen Dir", "Your first Chosen Dir was: " & $dir2) FileDelete($dir) FileDelete($dir2) Like i said.... Like this? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
SadBunny Posted March 5, 2007 Share Posted March 5, 2007 A little help here will do..thanks..the help examples in AutoIT cannot help me..=) You mean, writing a file to a location that you know beforehand? And not let the user choose it? Then just don't use a function that is explicitly meant to let the user choose a folder but just hardcode it, or have it read from a system var or something. For instance, if you want to save something to your (or any other user's) My Documents\folder1\folder2, you could do something like: $fileHandle = FileOpen(@MyDocumentsDir&"\folder1\folder2\somefile.txt",10) FileWriteLine($fileHandle,"This line is a test line.") FileWriteLine($fileHandle,"This file is a test file to write test lines in.") FileClose($fileHandle) Might this be what you mean? Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
cedrIck Posted March 5, 2007 Author Share Posted March 5, 2007 Hi SadBunny. Thanks for ur help..but i juz wan to save my folder. So how do i send the directory to it?.. $fileHandle = FileOpen(@MyDocumentsDir&"\folder1\folder2\somefile.txt",10) FileWriteLine($fileHandle,"This line is a test line.") FileWriteLine($fileHandle,"This file is a test file to write test lines in.") FileClose($fileHandle) Send($fileHandle) izzit something like tat??..sorry..i'am quite noob to this software..hope to have ur reply back.. =) Link to comment Share on other sites More sharing options...
cedrIck Posted March 5, 2007 Author Share Posted March 5, 2007 Like i said.... Like this?Hi Bert. Thanks for ur help. But i dun understand this part.$IntDir = ""$dir = FileSaveDialog("Save", $IntDir, "Text Files (.txt)") & ".txt"MsgBox(0, "Chosen Dir", "Your first Chosen Dir was: " & $dir)$IntDir = $dir$dir2 = FileSaveDialog("Save", $IntDir, "Text Files (.txt)") & ".txt"MsgBox(0, "Chosen Dir", "Your first Chosen Dir was: " & $dir2)FileDelete($dir)FileDelete($dir2)Why must FileDelete($dir) , FileDelete($dir2)??...i dun quite understand this part..can u help me to elaborate??..sorry and thanks.. =) Link to comment Share on other sites More sharing options...
SadBunny Posted March 5, 2007 Share Posted March 5, 2007 Hi SadBunny. Thanks for ur help..but i juz wan to save my folder. So how do i send the directory to it?.. [code snip] Send($fileHandle) izzit something like tat??..sorry..i'am quite noob to this software..hope to have ur reply back.. =) Send() sends simulated keystrokes to the active window. Use this to simulate keyboard keystrokes. Not to operate on files. I'm sorry but it is still a bit unclear what exactly you want to do, even after all your attempts to explain. Might it be that you want to backup a folder? (Btw, folder is the same thing as directory, only 'folder' has been used since GUI-based operating systems started using folder icons to represent directories. Make sure you don't mix that up; if you think they are different then please explain what concepts you mean.) Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
cedrIck Posted March 5, 2007 Author Share Posted March 5, 2007 Hi SadBunny. Sorrie abt the confusion. I explain it again. I have a program called Synergee and after doing all the open file doing reports and i have come to the final part of the steps which is saving the file. Normally we press Ctrl+S to save the file and by pressing Ctrl+S, it comes out a Save As box. My question is by using these commands(below), izzit the same as saving by pressing Ctrl+S??..$IntDir = ""$dir = FileSaveDialog("Save", $IntDir, "Text Files (.txt)") & ".txt"And for my that part of question still in my mind is that, I wan the computer to automactically select the folder as in to Save in. For example: "C:\Documents and Settings\C3DRICK\My Documents\Folder 1\Folder 2\Folder 3", this is my directory to save my .txt file inside the Folder 3. And if by pressing Ctrl+S, and which command should i use to make the computer select the Folder 3 to save my text file inside??..thanks..i realli need this help..hope to get ur reply soon.. =) Link to comment Share on other sites More sharing options...
cedrIck Posted March 5, 2007 Author Share Posted March 5, 2007 Hello again..is there anyone out there who can explain my doubts??..i reali appreciate it if someone does..thanks.. =) Link to comment Share on other sites More sharing options...
SadBunny Posted March 5, 2007 Share Posted March 5, 2007 (edited) Hi SadBunny. Sorrie abt the confusion. I explain it again. I have a program called Synergee and after doing all the open file doing reports and i have come to the final part of the steps which is saving the file. Normally we press Ctrl+S to save the file and by pressing Ctrl+S, it comes out a Save As box. My question is by using these commands(below), izzit the same as saving by pressing Ctrl+S??..$IntDir = ""$dir = FileSaveDialog("Save", $IntDir, "Text Files (.txt)") & ".txt"And for my that part of question still in my mind is that, I wan the computer to automactically select the folder as in to Save in. For example: "C:\Documents and Settings\C3DRICK\My Documents\Folder 1\Folder 2\Folder 3", this is my directory to save my .txt file inside the Folder 3. And if by pressing Ctrl+S, and which command should i use to make the computer select the Folder 3 to save my text file inside??..thanks..i realli need this help..hope to get ur reply soon.. =)I think you have some more AutoIt practising to do :-)Sending a CTRL+S keystroke combo to Windows would be done by Send("^s"), but you cannot modify this command to select a specific folder to save to, since it just sends CTRL+S to some application, starting the default procedure for CTRL+S (meaning, normally, a regular Save File dialog of the application in question).If you want your app to save something to a specific file using simulated keystroke commands (the Send() function) and the regular file save dialog of the app, you would have to use Send("^s"), BUT you would also need to simulate the keystrokes that you would need to select a folder manually. (I would suggest to send: 1. CTRL+S, 2. The DELETE key (since the save dialog mostly contains something like *.txt but selected, you want to remove that!), 3. The string containing the target folder&file. like C:\Docs\Folder1\Folder2\something.txt. See the Send() help for information how to send that stuff.) Edited March 5, 2007 by SadBunny Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
cedrIck Posted March 5, 2007 Author Share Posted March 5, 2007 I think you have some more AutoIt practising to do :-)Sending a CTRL+S keystroke combo to Windows would be done by Send("^s"), but you cannot modify this command to select a specific folder to save to, since it just sends CTRL+S to some application, starting the default procedure for CTRL+S (meaning, normally, a regular Save File dialog of the application in question).If you want your app to save something to a specific file using simulated keystroke commands (the Send() function) and the regular file save dialog of the app, you would have to use Send("^s"), BUT you would also need to simulate the keystrokes that you would need to select a folder manually. (I would suggest to send: 1. CTRL+S, 2. The DELETE key (since the save dialog mostly contains something like *.txt but selected, you want to remove that!), 3. The string containing the target folder&file. like C:\Docs\Folder1\Folder2\something.txt. See the Send() help for information how to send that stuff.)Erm..sorry again..so meaning that by pressing Ctrl+S, i can't type anything in the Save in icon??..i want my directory to appear in the Save in directory. Is there no way??..meaning the user has to manually select the folder itself??..still blur.. Link to comment Share on other sites More sharing options...
Shevilie Posted March 5, 2007 Share Posted March 5, 2007 Id it init dir ??? there you can selcet default safe folder??? Is it FileSaveDialog ( "title", "init dir", "filter" [, options [, "default name"]] ) Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit Link to comment Share on other sites More sharing options...
cedrIck Posted March 6, 2007 Author Share Posted March 6, 2007 Hi all, I would realli appreciate it if someone can explain to me abt the FileSaveDialog command. thanks. I would like to ask if i were to use notepad and i written some text into it, and want to save it inside this folder, the directory is "C:\Documents and Settings\C3DRICK\My Documents\Folder 1\Folder 2\Folder 3". So is this command appropriate??.. I know by using this FileSaveDialog, it comes out a Save box dialog. But what i want to know is by pressing Ctrl+S, izzit the same as this dialog box??..izzit a program that don't have a Save fuction, thats why we use FileSaveDialog??...is my guess correct?..i hope someone can clear my doubts on this..Thanks.. =) Link to comment Share on other sites More sharing options...
cedrIck Posted March 6, 2007 Author Share Posted March 6, 2007 HELP!! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now