Page 1 of 1
Select Folder
Posted: 2008-10-19 09:29:59
by Nicezia
is there anyway to select a folder through scripting
I've been checking out delphi pages, and SelectDirectory doesn't seem to work in the scripting engine.
is there a alternate command to display a directory select dialog? or is that an unrealistic approach as far as scripting goes?
Posted: 2008-10-19 09:59:16
by antp
Only few basic functions were added to the script engine.
As far as I know, only way to input a folder name is to ask the user to type it or to copy/paste it
Posted: 2008-10-19 10:08:49
by Nicezia
well darn, that kinda defeats my script, but i guess o could input the folder location manually.
Posted: 2008-10-19 10:10:45
by Nicezia
antp wrote:Only few basic functions were added to the script engine.
As far as I know, only way to input a folder name is to ask the user to type it or to copy/paste it
well if that's the case, i need to know if there are a few functions in there, specifically : 'WriteLn', 'ReadLn' and other file specific functions, if not what are their equivalents?
thanks for all your help.
it'd be nice have that feature , but not neccessary.
Re: Select Folder
Posted: 2008-10-19 10:35:03
by bad4u
Nicezia wrote:is there a alternate command to display a directory select dialog? or is that an unrealistic approach as far as scripting goes?
Well, I guess it should be possible to build some kind of selection menu using PickTree and ListDirectory nevertheless. Analyze the ListDirectory results, list the directories only using PickTree and add an extra item to select chosen folder (all within a loop). Current folder could be shown on the list. On PickTree window it would look like :
- Current folder is C:\programs\Ant Movie Catalog
..
\catalogs
\scripts
\templates
Choose current folder
Not that easy and a workaround only, but possible (although never tested that)
Note: Not sure if this would work for changing drive letters, too.
Most of file specific functions that can be used on scripts, can be found on AMC help file, see Technical Specifications - Script files creation (or press help on AMC editor).
Re: Select Folder
Posted: 2008-10-19 14:01:12
by Nicezia
bad4u wrote:Nicezia wrote:is there a alternate command to display a directory select dialog? or is that an unrealistic approach as far as scripting goes?
Well, I guess it should be possible to build some kind of selection menu using PickTree and ListDirectory nevertheless. Analyze the ListDirectory results, list the directories only using PickTree and add an extra item to select chosen folder (all within a loop). Current folder could be shown on the list. On PickTree window it would look like :
- Current folder is C:\programs\Ant Movie Catalog
..
\catalogs
\scripts
\templates
Choose current folder
Not that easy and a workaround only, but possible (although never tested that)
Note: Not sure if this would work for changing drive letters, too.
Most of file specific functions that can be used on scripts, can be found on AMC help file, see Technical Specifications - Script files creation (or press help on AMC editor).
thanks, i didn't even know that existed in the helpfile
I swear i've learned more about scripting for AMC in the last 6 hours than i have about C,C++,C#, and Visual Basic combined in the last 6 months (and that's putting an honest effort into it on both counts)
Thanks to you and
antp, i have a fully working script now.
Re: Select Folder
Posted: 2008-10-19 19:33:34
by antp
bad4u wrote: Analyze the ListDirectory results, list the directories only using PickTree
I thought to that one but I forgot that it was listing directories too, I thought that I made it for files only
For writeln/readln there is only the LoadFromFile and SaveToFile of the TStringList class
e.g.
Code: Select all
procedure SaveToFile(Text: string; FileName: string);
var
Page: TStringList;
begin
Page := TStringList.Create;
Page.Text := Text;
Page.SaveToFile(FileName);
Page.Free;
end;
Re: Select Folder
Posted: 2008-10-22 03:34:47
by Nicezia
yeah pretty much figuired out load and save files
but i appreciate the input