PDA

View Full Version : Folder name


JDog37
02-12-2009, 06:31 AM
Hello all, I got a question: My .apz creates a "project" folder on the users desktop when they click the button.

I want them to be able to name the folder to what they want, then it creates that folder.

BUT also there are many buttons to create other folders inside of that "named folder".

I have all the buttons working but how do I get the folders into the users named folder. Understand? :D

The project is a folder maker for the users. Like a "work folder" for their projects.

Many thanks guys,
Joe

holtgrewe
02-12-2009, 07:44 AM
Dog,

There are numerous ways to accomplish this.
The first thing that comes to mind would be to invoke a Dialog.Input() event requesting the folder name, then use your Folder.Create().

You could insert another button to Folder.Rename() to rename the folder.
hth

JDog37
02-12-2009, 01:11 PM
Thank you holtgrewe, Now the thing is how would I write the code to insert the other folders into it. Here's what I mean.

Folder.Create(_DesktopFolder.."\\Work Field"); <--(Here is where the user would rename the folder)

But how will I be able to make these folders inside the users renamed one??

Folder.Create(_DesktopFolder.."\\Work Field\\Cars");
Folder.Create(_DesktopFolder.."\\Work Field\\Cars\\Trucks");
Folder.Create(_DesktopFolder.."\\Work Field\\Cars\\Trucks\\Vans");

Im like lost on how to do this..

Thanks,
Joe

ShadowUK
02-12-2009, 02:15 PM
while (_G) do
strFolder = Dialog.FolderBrowse("Select a folder for storing data.", _DesktopFolder);

if (strFolder ~= "CANCEL") then
break;
end
end

Folder.Create(strFolder);
Folder.Create(strFolder.."\\Cars\\");
Folder.Create(strFolder.."\\Cars\\Trucks\\");
Folder.Create(strFolder.."\\Cars\\Trucks\\Vans");

JDog37
02-12-2009, 03:01 PM
Nice work shadowuk! Thank you. :yes

Joe

JDog37
02-12-2009, 08:29 PM
Ok I got my folders to work right.

When the button is clicked it puts a new work folder on the desktop or wherever they want, (Thanks ShadowUk!) Now say I have a few buttons that make other folders, (I do) and say the user wants folders to go into other folders, (Sub Folders) in the "work field" folder, instead of all in just the "Work Field" folder. They pic what folder they want the sub folder to go into.. (Maybe like their own categories the way they want)

How can I do this?

Ex: "Work Field" (Main Root Folder) User wants Cars, trucks, vans and parts folders in the work field, BUT wants the parts in the truck folder as a sub folder only, NOT in the "Work Field" folder.

Whoo, that was confusing to write out but thats it.. :wow

May the code gods please help, :D

Thanks humbly,
Joe

Protocol
02-13-2009, 01:19 AM
Love to help, brother.

I've read this a few times, but I'm not sure I completely get it. It sounds like you're asking a GUI interface design question. I may be completely off, but if so, then I would resort to a listbox wherein the user can multi select which folders they want to add the current folder to. The list would display all of the available folders and using some fun keys such as ">", you can define a folder as a sub folder. Then again, I've never used the tree menu and I'm certain that that would be better for this sort of interface.

Again, sorry if I'm way off on this. I didn't fully understand the project. :o If you want to post or send me the apz or exe, I'll take a look at make a suggestion for ya.

Protocol

JDog37
02-13-2009, 07:33 AM
Ok here you go. I hope this clears it up! lol Thank you for the time, much appreciated!

Thanks,
Joe

JDog37
02-13-2009, 05:55 PM
Anyone care to take a stab at it? Lol.. :o

rexzooly
02-14-2009, 04:20 AM
Anyone care to take a stab at it? Lol.. :o

do you mean you want your app to globaly remeber the folder your user as made? this is that i think your trying to say maybe set a functions

i will do it with a simple it saves a txt file named the same thing
so the app will always remeber the folder

RootFolder();

RootFolder = function()
RootName = TextFile.ReadToString(SourseDrive.."\\dataread.txt");
if RootName == "" then
while (_G) do
strFolder = Dialog.FolderBrowse("Select a folder for storing data.", _DesktopFolder);

if (strFolder ~= "CANCEL") then
break;
e
else
strFolder == RootName;
end
end;

rexzooly
02-14-2009, 04:42 AM
that was just a so so post not tested i have made this .. might help you :yes
also fixed my own error in the code i posted

hope this helps a little:D

JDog37
02-14-2009, 10:47 AM
Thank you rexzooly! I am a little confused as well.. Not sure if its possible but how it ask where yo want the folder to be placed.. Is it possible to do it maybe in like a tree function?? I'm not sure what you wanted the check box for tho- Can you explain? :wow

OR maybe even a drag and drop the folders where they want them. The folders would be already to pick from so all they would have to do is drop them where they would want them to go?? Possible??

Thank you all for the help I am getting, :yes:yes:yes:yes
Joe

rexzooly
02-14-2009, 11:24 AM
Thank you rexzooly! I am a little confused as well.. Not sure if its possible but how it ask where yo want the folder to be placed.. Is it possible to do it maybe in like a tree function?? I'm not sure what you wanted the check box for tho- Can you explain? :wow

OR maybe even a drag and drop the folders where they want them. The folders would be already to pick from so all they would have to do is drop them where they would want them to go?? Possible??

Thank you all for the help I am getting, :yes:yes:yes:yes
Joe

look in the code that check box as you stated anywhere else if you click the check box it will save it in the same folder like the parts and so on files but if not checked it will ask the user to pick a place for it to be save thats all
really.

try and explane little more what your trying to do and i see if i can update my example a little more when i am at my computer on my laptop with linux live CD and remoting a nother windows pc so no ams at the mo.

:yes

JDog37
02-14-2009, 12:57 PM
I hope this can help out. I tried to explain in detail..

THANK you so much for the help!!
Joe

rexzooly
04-22-2009, 05:14 AM
Sorry ur app really got me confused what you wanting to do lol