Jump to content
Macro Express Forums

Create folder in current folder

Recommended Posts

Having problems. This is what I want to do:

Create a new folder in the current folder and name the new folder the same as a selected document.


Start the macro while in a windows folder and with a document (in that folder) selected.


1. Variable set string %T1% to topmost window title.

This sets the variable to the path of the current folder, but if the pathname is over 96 characters it truncates and does not work. Can I increase the length of a variable or is there a better way to obtain the current path?


2. Text Type <F2>

this edits the currently select document filename. the part of the name I want to copy is highlighted (in windows7 the filename less the extension is highlighted)


3. Clipboard Copy


4. Variable set string %T2% from the clipboard contents

T2 is the name I want to use for the new folder.


5. Create folder %t1%\%t2%

This works, but only if the filepath string length (from 1 above) is not too long.



Please help with 1 and 5 above. (or is there a better method?)



Link to comment
Share on other sites

Cory, both those methods can get the filepath into the copy buffer. My problem is I cannot store the copy buffer to a variable because the string length is too long. I need filepath and filename stored as variables for the "Create Folder" method to work.



My file server has extremely long path names. For now I just drag the folder to drive C:\ run the macro and then drag it back.

Link to comment
Share on other sites

You are right. I can store more in a variable. The variable gets truncated using this....


<VARIABLE SET STRING Option="\x05" Destination="%T1%" _ENABLED="FALSE"/>


to set the variable T1 to the window title. It works for short filenames so I assumed the variable length was the problem.


So let me backup.

1. If I go to the address bar and copy there. (alt-d gets to the address bar)

I can get the variable set correctly.




Figured out another method to try: "alt-shift-n" creates a new folder in the current explorer window (don't need the pathname). Just rename the new folder to T2


Thanks Cory

Link to comment
Share on other sites

I suppose it depends on your OS as well. In W8 I don't see the path in the title. Also I'm guessing Windows truncates the rath if it's too long to display.


In cases like this I try to avoid using Windows Explorer at all. It's better to use Macro Express's file and folder manipulation commands. To add a sub directory would be easy using the Variable Set From Path command.

Link to comment
Share on other sites

  • 1 month later...

Thanks! It was broken however. The guy I had implement that had programmed it to use the form message as a subject. Bad form. Literally. So if there was a newline it would throw an exception.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...