Selecting a folder automatically

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
RNIB
Macro Veteran
Posts: 198
Joined: Thu Jan 10, 2008 10:25 am
Location: London, UK

Selecting a folder automatically

Post by RNIB » Fri Jun 12, 2009 10:10 am

Couldn't think of a better subject title.

Basically I'm trying to write a macro to completely automate a task which involves using a few programs. In order to do this I first need the user to enter a few bits of information which are stored as variables for later use, one of which being the path to the folder containing the audio files that are needed.

Gathering that information is simple enough but I've hit one problem that I can't seem to solve.

One one line of my macro I have:

Code: Select all

Let>INPUT_BROWSE=2
Input>Bounce,Please Locate The Bounce Folder,F:\

The user navigates to the correct folder and that path is stored in the variable "Bounce".

Later in the macro I launch a program, go through the initial stages of setting up the project in that program and then we come to the stage where the program asks me to locate the audio files.

At this stage I get the macro to click the Browse button in the program which then opens a fairly standard Windows Browse window (see screen grab below)

Image

How can I navigate to the path stored in the Bounce variable in this window? It won't let me enter the path in the address bar and the only way seems to do it in stages i.e. select My Computer, Select the Drive, Select the Folder

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Jun 12, 2009 12:25 pm

It won't let me enter the path in the address bar
Not sure what you mean by the "address bar".

Every browse dialog I've dealt with let me paste the information into the File name field. Which is usually already highlighted when the window opens.

RNIB
Macro Veteran
Posts: 198
Joined: Thu Jan 10, 2008 10:25 am
Location: London, UK

Post by RNIB » Fri Jun 12, 2009 12:45 pm

By "Address Bar" I mean in the field which is labelled, in the screen grab, "Look In:" and currently says "EasePublisher211".

I can't enter anything in here with the keyboard that resembles a path like, for example, F:\AliceByAccident. The only keyboard functions that do work in this field are the up and down arrows or entering the first letter of the name of the drive. For the network drive that has the folders that contain the audio we need is named "bounce on 'camdenaudio\data' (F:)" - This is how Windows displays it in My Computer and in all Folder Browse Windows. If I press the letter "B" I can select this drive but I can't 'jump' to the actual folder I want.

The only way I can think of doing this is to break down the variable so that when the macro first runs it asks the user to locate the folder containing the audio files which it stores in the Bounce variable. This variable is then passed to a subroutine that strips off the F:\ bit leaving just the folder name which is then stored in another variable. Once the macro gets to the stage above I could write the macro to find the required drive and then find the folder based on the 'restructured' variable.

Apart from the fact that I don't know how to strip the F:\ bit from the Bounce variable it's also seems very cumbersome which was why I was wondering if there was a better way of doing this.

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Jun 12, 2009 1:03 pm

As I said before, paste the path with or without file name into the "File name:" field. The path is part of the file name so that should work. If you enter the path and file name, the current path settings of the dialog ( the location indicated under "Look in:") is ignored and the file will open. If you enter just the path, The path under "Look in" should change.

You can "paste" your variable by highlighting the "File name:" field then:

PutClipboard>%Bounce%
Press>CTRL
Send>v
Release CTRL


OR even simpler... one line.

Send>%Bounce%

RNIB
Macro Veteran
Posts: 198
Joined: Thu Jan 10, 2008 10:25 am
Location: London, UK

Post by RNIB » Fri Jun 12, 2009 1:10 pm

You know that feeling you get when you realise you've been an utter fool and missed the bloomin obvious? Yeah, that's how I'm feeling :oops:

Apologies for being so dense and thanks again

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri Jun 12, 2009 1:16 pm

Feeling foolish is my state of being. Glad I could help. Hopefully your dialog behaves the way most dialogs behave and this technique works.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts