Announcement

Collapse
No announcement yet.

Need a bit of help from the pro's. Esctract .iso

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Old Fellow
    replied
    Originally posted by Ulrich View Post
    You don't need to "write to a string". You need to concatenate the strings.

    Code:
    local sCmdLineArgs = "x -y -o\"" .. filefound[1] .. "\"";
    Dialog.Message("Info", "I need to run 7zip with this command line: " .. sCmdLineArgs);
    Once you have the argument, and you know where your 7zip program is placed, you need to use Shell.Execute() or File.Run() to execute the desired command. No need to write anything... unless you absolutely want to write to a text file.

    Ulrich
    @Ulrich

    Cheers for that extra bit of info. I will surely give it a good read and see if I can understand it.

    Just before I read the last post from you I did get my head round writing a string from a table.

    It worked a treat.

    gotit = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "All Files (*.*)|*.*|", "", "dat", false, false);
    TextFile.WriteFromTable("C:\\Users\\Malc's PC\\Desktop\\new.txt", gotit, false);
    With what you just put I know it is not exactly what I want\need but I am happy a little bit more as sunk in and I have learnt summet knew.

    Another step closer....

    Thank you..

    Leave a comment:


  • Ulrich
    replied
    You don't need to "write to a string". You need to concatenate the strings.

    Code:
    local sCmdLineArgs = "x -y -o\"" .. filefound[1] .. "\"";
    Dialog.Message("Info", "I need to run 7zip with this command line: " .. sCmdLineArgs);
    Once you have the argument, and you know where your 7zip program is placed, you need to use Shell.Execute() or File.Run() to execute the desired command. No need to write anything... unless you absolutely want to write to a text file.

    Ulrich

    Leave a comment:


  • Old Fellow
    replied
    you know this is what I want..

    I am not after, "please do it for me".

    Pointers !!!!!

    You pointed and I followed.

    One step further.

    filefound = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "All Files (*.*)|*.*|", "", "dat", false, false);
    Dialog.Message("Notice", filefound[1]);
    I get a message of the file path...Brilliant.

    Just need to write to string...

    cheers...

    Leave a comment:


  • Old Fellow
    replied
    Originally posted by Ulrich View Post
    Please check the documentation - the examples provided in the help file - for Dialog.FileBrowse(). There are three examples, and you can find many more in this forum.

    Ulrich
    examples ??

    Who knew....Nice one..

    Leave a comment:


  • Ulrich
    replied
    Please check the documentation - the examples provided in the help file - for Dialog.FileBrowse(). There are three examples, and you can find many more in this forum.

    Ulrich

    Leave a comment:


  • Old Fellow
    replied
    Sorry...

    I understand some of what your saying.
    I get the lua and vbs are totally different.

    So let me see if I can explain what I do and do not understand.

    I make a Dialog.FileBrowse
    I give it a result varialble

    filefound = Dialog.FileBrowse

    this I understand.

    So when the user browses for their chosen file and clickes "open" are you saying there is a table of the files information automaticly stored in the result "filefound"

    in this table there is the full path of the file.

    Am I understanding that correctly ?

    If this is right how do I ask AMS to show me this table of information ?

    I looked at "table"

    it says

    Table.Concat

    Returns
    (string) A string containing the table values, separated by the delimiter you chose. If an error occurs, a blank string "" is returned.

    This is confusing me.

    Am I on the right track ?

    Let me thank you, please stick with me.

    Leave a comment:


  • Ulrich
    replied
    AutoPlay Media Studio uses Lua, not VBScript. There is no need at all to mix languages, as string concatenation is easy in Lua - using the ".." operator, as already shown in this very topic.

    If you use Dialog.FolderBrowse() to allow the user to locate a file, the documentation shows you that this action will return a table, where each element contains the full path to a selected file (in case you allowed multiple selection), or the text "CANCEL" as the first element in case the user aborted the selection.

    One you have the full path to the file, you have to concatenate this path to the fixed "7z x -y -o" part to assemble the command line you wish to execute.

    You don't need File.GetAttributes() for anything at this time. You also don't need to create a batch or cmd file, as there are actions like Shell.Execute() and File.Run() you can use to perform the extraction.

    Ulrich

    Leave a comment:


  • Old Fellow
    replied
    been thinking about this and doing a lot of reading and testing.

    I have gotten a little further but still a fair way to go.

    So I have my .cmd
    7z x -y -oC:\DISM\7zip\files C:\DISM\7zip\TEMP\*.iso
    The first part is always going to be a constant
    7z x -y -oC:\DISM\7zip\files
    What I have is made a .cmd without the path to the .iso image.

    Using a vbscript I have learnt to append my extract.cmd so it adds the path of the .iso to the end of the code allowing the ectraction to take place.

    Option Explicit
    Dim FSO, oFILE,x
    Const READ=1,WRITE=2,APPEND=8
    Set FSO = CreateObject("Scripting.FileSystemObject")

    Set oFILE = FSO.OpenTextFile("C:\DISM\7zip\extract.cmd",APPEND )

    oFile.Write " C:\DISM\7zip\TEMP\*.iso"
    This is all well and good but I still need to be able to read to string the path of a chosen file then write it to my extract.cmd.

    I am currently learning how to do this with a vbscript, thinking it might help me understand how to do it in AMS.

    In AMS I know

    Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "All Files (*.*)|*.*|", "", "dat", false, false);
    how , or is it possible to set the result of the file browse and the selection of a file to read the path of the given file.

    This confuses me.
    Is it read to string ?

    I look in the help file and it mentions
    File.GetAttributes
    It does mention
    Directory
    boolean
    True if the directory attribute is set.
    but what this means I do not know.

    Any more pointers please.

    cheers..

    Leave a comment:


  • Old Fellow
    replied
    Thanks for those replies.

    Will give them a good read.

    Leave a comment:


  • Ulrich
    replied
    Originally posted by Cybergraph View Post
    If you need to have a feedback from the executed command (example, get the message returned by the command) use the CommandLine plugin.
    This also can be done with pure Lua, without any plugins:

    Code:
    local sCommand = "\"".._SystemFolder.."\\cmd.exe\"" .. " /c DIR " .. _TempFolder;
    local sOutput = "";
    
    for sLine in io.popen(sCommand):lines() do
       sOutput = sOutput .. sLine .. "\r\n";
    end
    Dialog.Message("Output", sOutput);
    Ulrich

    Leave a comment:


  • Cybergraph
    replied
    You could use execute any DOS command from AMS using the "File.Run" or "Shell.Execute functions.

    If you need to have a feedback from the executed command (example, get the message returned by the command) use the CommandLine plugin.

    In both cases, the command line can be explicit, example:

    Code:
    File.Run("7z.exe", "x -y -o C:\\DISM\\7zip\\files E:\\test\\pics.iso");
    or can contain variables:

    Code:
    parameteres = "x -y -o ";
    first_path = "C:\\DISM\\7zip\\files ";
    second_path = "E:\\test\\pics.iso";
    example: File.Run("7z.exe", parameteres..first_path..second_path);
    example:

    Code:
    CommandLine.Execute("ping 127.0.0.1", 0);
    or

    Code:
    var_a = "ping 127.0.0.1"
    CommandLine.Execute(var_a, 0);

    Leave a comment:


  • Old Fellow
    replied
    I have just tested my extract.cmd out.

    I placed my test iso image containing a few pics so it is not too big is size in dir
    E:\test
    made a new extract.cmd

    7z x -y -oC:\DISM\7zip\files E:\test\pics.iso

    pause
    Worked perfectly. :lol

    so it's just the other part, writing the dir to my extract.cmd.

    If this is possible what is the process called ?

    write string ?
    write field ?

    Off to open up AMS and look inside..

    Leave a comment:


  • Shrek
    replied
    File browse is user orientated whereas file find is not.

    Leave a comment:


  • Old Fellow
    replied
    Hey up..

    So here is my extract.cmd.

    7z x -y -oC:\DISM\7zip\files C:\DISM\7zip\pics.iso

    pause
    Obviously the "pause" will be omitted but I like to see what's going on at the beginning..

    What I just thought of a while back, can a filebrowse locate a file and write it's dir to my extract.cmd

    example.

    disc.iso is on a PC in
    F:\images\mydisc.iso
    can that dir be written to my extract.cmd

    so it would end up like

    7z x -y -oC:\DISM\7zip\files F:\images\mydisc.iso

    is that possible ?????????

    cheers..

    Leave a comment:


  • Old Fellow
    replied
    Just had a thought.

    If you make a dialogue.filebrowse, is there a way to take the folder dir say E:\ MyFiles\mydisc.iso and write this to my extract.cmd so it points to my chosen file ?

    Does that make sense.

    On my iPad at the mo. Later I will show my extract script.

    If this is possible it may be the solution but what this process is called I don't know.

    ?????

    Leave a comment:

Working...
X