 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
beetlejuice
Joined: 04 Jan 2010 Posts: 22
|
Posted: Thu Mar 18, 2010 5:14 am Post subject: default save-open folder,modify save as, open dialogue box ? |
|
|
how do you modify the save as and open dialogue boxes to e.g.
show all files when using a certain program, and to always show the same folder to open or save to, when using a specific program.
Does this need to be done in the registry for each program.
using vista home premium.
xp used to automatically keep these settings, but vista has problems with this and its a pain.
john |
|
| Back to top |
|
 |
Leef_me
Joined: 08 Apr 2009 Posts: 5336 Location: San Diego, California
|
Posted: Thu Mar 18, 2010 10:37 am Post subject: |
|
|
you are talking about programs external to Ahk, right?
Doesn't the program in question 'learn' where you want the files stored or opened from?
Some programs have a configuration setting for these parameters.
If there is no such configuration, you need to write a routine that waits for the dialog box and tweaks the controls on that dialog box.
take a look at this example for some ideason how to wait and tweak:
http://www.autohotkey.com/docs/scripts/MsgBoxButtonNames.htm
But first:
Start with opening up Window Spy (in the Ahk directory) and looking at the name and class of the dialog window and the name of the control.
For notepad, in vista, I see the dialog as "Save As" with ahk_class #32770
save as type is ClassNN: ComboBox1
| Code: | f1::
; this sets the file type to All
Control, ChooseString, All, ComboBox2, Save As ahk_class #32770
; I had to click the control to get to the state where I could send text to the addressbar
ControlGetPos, X, Y, W, H, Edit2, Save As ahk_class #32770
mousemove, x+w/2+100,y+h/2, 10
click
; now the data is in a normal file address 'folder' format
;ControlClick , Edit2, Save As ahk_class #32770,, Left
sleep, 500
ControlSend , Edit2, ^a, Save As ahk_class #32770
sleep, 500
ControlSend , Edit2, {DEL}, Save As ahk_class #32770
sleep, 500
ControlSend , Edit2, {shift down}c:{shift up}\, Save As ahk_class #32770
sleep, 500
ControlSend , Edit2, {ENTER}, Save As ahk_class #32770
return
|
Try reviewing these instructions, can you see the purpose of the commands? |
|
| Back to top |
|
 |
Murx Guest
|
|
| Back to top |
|
 |
Murx Guest
|
Posted: Thu Mar 18, 2010 10:50 am Post subject: |
|
|
| Quote: | Edit the Places bar locations in 'Open/Save As' common dialog boxes
Published: June 27, 2004
Updated : Aug 03, 2005
The Places bar locations in a Common Dialog (Open/Save As) boxes can be customized to your choice of folders. To do so, try the following methods:
Open Registry Editor and navigate to:
HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ comdlg32 \ Placesbar
By default the Placesbar key is not present; you need to create one.
Create a String value for it named Place0. Place0 is the top-most folder as it appears on the Open/Save As dialog. Type the folder name with it's full path as the value of Place0. You can create similar keys and values upto Place4. Sample places bar registry key in my system:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\comdlg32\PlacesBar]
"Place0"="e:\\XP Utils"
"Place1"="e:\\research"
"Place2"="e:\\Registry Patches"
"Place3"="e:\\UtilitiesSet 2"
"Place4"="e:\\UtilitiesSet 1" | Combined with IfWinActive you could try to update that reg settings on-the-fly to create app related "save-as"-profiles. Good luck  |
|
| Back to top |
|
 |
Murx Guest
|
Posted: Thu Mar 18, 2010 10:56 am Post subject: |
|
|
Another thing you could have a try: autoselect another view option.
| Quote: | Open a common dialog box, change the view to the one you want, and then
hit Ctrl/Cancel. Yes, it's counterintuitive, but this solution is in Ed
Bott's book "Windows XP Inside and Out" and it works. |
|
|
| Back to top |
|
 |
Murx Guest
|
|
| Back to top |
|
 |
Murx Guest
|
Posted: Thu Mar 18, 2010 11:58 am Post subject: |
|
|
The registry contains some file extension related settings which seems to influence OpenSave dialogs:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\txt
So if you open Notepad (the standard assigned app for txt files) and you run this code, before you call the Open/Save-dialog ... | Code: | RegWrite, Reg_SZ, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\txt, k, c:\mydir\mysubdir ; change this path !
RegWrite, Reg_SZ, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\txt, MRUList, kabcdefghij | ... the dialog will open at YOUR path (hopefully ).
I guess if you do the same for the 'extension' > * < (All files) it'll work the same for unassigned file extensions.
Good luck  |
|
| Back to top |
|
 |
beetlejuice
Joined: 04 Jan 2010 Posts: 22
|
Posted: Thu Mar 18, 2010 4:59 pm Post subject: |
|
|
Leef_me, was playing with your code, works good, still trying to understand it.
this is what i came up with last week, its crude and needs some work. took hours of guessing, but was hoping for a registry fix,
problem with code below is i need the combox number to be able to change to 2 or 3 depending on the program, but windows spy does not show this unless i click on the save as type: box.
do i need to write a list of various programs, so if notepad combobox = 2, or if vidredo combobox = 3 e.t.c.
i just wanted to click on the window of the prog i was using, and it automatically would get the open window to show all files when pressing f1 or save when pressing f2,
"WinMenuSelectItem, ahk_class %aTitle%, , 1&, 1&," this part of the code needs changing as different progs use different menu values.
or i could use a simpler method using ctrl+o or ctrl+s
| Code: | f1::
;MsgBox, The text is:`n%OutputVar%
WinGetClass, aTitle, A
;MsgBox, The active window is "ahk_class %aTitle%".
WinMenuSelectItem, ahk_class %aTitle%, , 1&, 1&,
MouseClick, left, 918, 589; click anywhere on the window
sleep,100
WinGetClass, bTitle, A
;MsgBox, The active window is "ahk_class %bTitle%".
;WinMenuSelectItem, ahk_class %bTitle%,
ControlClick, ComboBox3, ahk_class %bTitle%, ;All Files
Send, {DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN} ;pathetic peice of code, as all files are usually at the bottom
Send, {ENTER} |
murx, do i change registry keys of a specific program, i use a video editing program, and the main files i open do not have a
file name extension, this is why i need the folder to show all files. |
|
| Back to top |
|
 |
Leef_me
Joined: 08 Apr 2009 Posts: 5336 Location: San Diego, California
|
Posted: Thu Mar 18, 2010 6:15 pm Post subject: |
|
|
| beetlejuice wrote: | | do i need to write a list of various programs, so if notepad combobox = 2, or if vidredo combobox = 3 e.t.c. | AFAIK, Yes.
| Quote: | | or i could use a simpler method using ctrl+o or ctrl+s | sccriptwriter's choice.
| Quote: | | ControlClick, ComboBox3, ahk_class %bTitle%, ;All Files | Ahh, no, terrible thing
| Quote: | | Code: |
Send, {DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN}{DOWN} ;pathetic peice of code, as all files are usually at the bottom
Send, {ENTER} |
|
Send, {DOWN 10}
or
Send, {DOWN 12}
or
Send, {PgDn}
| Quote: |
murx, do i change registry keys of a specific program, i use a video editing program, and the main files i open do not have a
file name extension, this is why i need the folder to show all files. |
Are you sure the O.S. isn't just hiding the extension from you ? |
|
| Back to top |
|
 |
Murx Guest
|
Posted: Thu Mar 18, 2010 7:53 pm Post subject: |
|
|
| Quote: | and the main files i open do not have a
file name extension | As Leef_me said, it could be that the extension is handled as 'hide known file extensions" were "known" means already assigned to an app. I expect that means that once you select the open dialog in Excel it'll offer you xls, while for W(inw)ord it'll show you doc, Notepad --> txt, Adobe Acrobat --> pdf, ... |
|
| Back to top |
|
 |
beetlejuice
Joined: 04 Jan 2010 Posts: 22
|
Posted: Fri Mar 19, 2010 2:50 pm Post subject: - |
|
|
slowly getting there,
| Code: | f1::
MouseClick, left, 100, 10 ; click anywhere on the window
DetectHiddenWindows on
sleep,10
WinGetClass, aTitle, A
IfWinActive, ahk_class Notepad
{
comboboxx = ComboBox2
WinMenuSelectItem, ahk_class %aTitle%, , File, open
sleep, 10
}
if WinExist("Notepad")
{
MouseClick, left, 230, 104
Sleep, 10
}
sleep, 10
IfWinActive, ahk_class VideoReDoClass
{
WinMenuSelectItem, ahk_class %aTitle%, , File, open video
comboboxx = ComboBox3
}
MouseClick, left, 500, 500 ; click anywhere on the window
sleep,10
Control, ChooseString, All, %comboboxx%, Open ;ahk_class #32770
return
f2::
MouseClick, left, 100, 10 ; click anywhere on the window
sleep,10
WinGetClass, aTitle, A
IfWinActive, ahk_class Notepad
{
comboboxx = ComboBox2
WinMenuSelectItem, ahk_class %aTitle%, , File, save as
sleep, 200
}
if WinExist("Notepad")
{
MouseClick, left, 230, 104
Sleep, 10
}
sleep, 10
IfWinActive, ahk_class VideoReDoClass
{
WinMenuSelectItem, ahk_class %aTitle%, , File, save video as
comboboxx = ComboBox3
}
MouseClick, left, 500, 500 ; click anywhere on the window
sleep,10
Control, ChooseString, All , %comboboxx%, Save As ahk_class #32770
|
Much easier to save and open.
just need to add more programs.
Thanks all for the help. john |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|