Select Folder

If you made a script you can offer it to the others here, or ask help to improve it. You can also report here bugs & problems with existing scripts.
Post Reply
Nicezia
Posts: 14
Joined: 2008-10-17 04:41:01

Select Folder

Post 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?
antp
Site Admin
Posts: 9639
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post 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 :D
Nicezia
Posts: 14
Joined: 2008-10-17 04:41:01

Post by Nicezia »

well darn, that kinda defeats my script, but i guess o could input the folder location manually.
Nicezia
Posts: 14
Joined: 2008-10-17 04:41:01

Post 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 :D
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.
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Re: Select Folder

Post 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).
Nicezia
Posts: 14
Joined: 2008-10-17 04:41:01

Re: Select Folder

Post 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. :grinking:
antp
Site Admin
Posts: 9639
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Re: Select Folder

Post 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 :D

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;
Nicezia
Posts: 14
Joined: 2008-10-17 04:41:01

Re: Select Folder

Post by Nicezia »

yeah pretty much figuired out load and save files
but i appreciate the input
Post Reply