scripting prob
  • Order of the Butterfly
    Order of the Butterfly
    GMKai
    Posts: 256 from 2003/4/7
    After reading the scripting tutorial I tried to automate lame.elf.
    I wanted requesters to pop up for files to decode and a destination drawer, furthermore given options should be read from the script aswell.

    PS. something with my clipboard does not work, so I cannot include the script i have written so far easily.
  • »31.08.03 - 12:08
    Profile
  • Targhan
    Posts: 2833 from 2003/2/8
    From: USA
    @GMKai

    There are a few other secrets you would need to use for your project. First, you'll want to put your options into a variable, like so:

    Set LameOps="-hkm"

    Use whatever options you want, just make sure that you put all of your options into one variable, making the rest of the script easier to write.

    The next problem is, do you want to name the file when you encode something? If you don't mind typing in the name of the file, you don't have to do anything funny. Just type in the name of your output file into the destination requester.

    For example:
    requestfile initialvolumes >ENV:LameOutVar

    The input file requester will be very simular,
    requestfile initialvolumes >ENV:LameInVar

    The use of the options, in this example, is static, and the other two options are based on user selectable action. Now, you simply need to combine them all...

    SET LameCommand="Path/to/lame.elf" $LameOps $LameInVar $LameOutVar

    The above combines all of the variables into ONE string, LameCommand. Now, you can run your command. Simply place your new variable on a line by itself:

    $LameCommand

    That's it, finished! :-) It will not be too pretty this way, since you will have to type in the name of the outfile into a requester, but it should work.
    :idea:Targhan

    MorphOS portal? www.MorphZone.org
  • »31.08.03 - 16:44
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    GMKai
    Posts: 256 from 2003/4/7
    Is there a possibility to cut of parts of a string and add another string. I think of replacing .cdda with .mp3 and combining the path/filename.cdda to savepath/filename.mp3

    Any piece of advice?
  • »02.09.03 - 18:21
    Profile
  • Targhan
    Posts: 2833 from 2003/2/8
    From: USA
    I can't think of anything off-hand that will do what you ask, without dipping into ARexx. I'm sure there is, but I just don't happen to know if off hand.
    :idea:Targhan

    MorphOS portal? www.MorphZone.org
  • »02.09.03 - 19:08
    Profile Visit Website
  • Paladin of the Pegasos
    Paladin of the Pegasos
    Jupp3
    Posts: 1193 from 2003/2/24
    From: Helsinki, Finland
    Quote:

    I think of replacing .cdda with .mp3


    You could do dos script...

    Try something, like 'List #?.cdda LFORMAT="lame %n %m.mp3" '

    I did better script for that, can share it later...
  • »03.09.03 - 07:47
    Profile Visit Website