Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: open next file in the folder #8751
    tonne
    Participant

    Prev-file version…


    // This macro opens the prev ".txt" file in the current folder.
    //
    sFolder = document.Path;
    if( sFolder != "" ) {
    fso = new ActiveXObject("Scripting.FileSystemObject");
    f = fso.GetFolder(sFolder);
    fc = new Enumerator(f.files);
    sItem = "";
    for (; !fc.atEnd(); fc.moveNext()) {
    if( fc.item().name == document.Name ) {
    try {
    editor.OpenFile( sPath );
    }
    catch(e) {
    }
    break;
    }
    else {
    n = fc.item().name.lastIndexOf(".");
    if( n != -1 && fc.item().name.slice( n ) == ".txt" )
    sPath = sFolder + "" + fc.item().name;
    }
    }
    }
    in reply to: needs help on a macro to insert number row #8403
    tonne
    Participant

    prompt returns a string; is “2” < "10" ?

    in reply to: needs help on a macro to insert number row #8401
    tonne
    Participant

    Try
    if (Math.abs(i) < Math.abs(n)) { //ascending

Viewing 3 posts - 1 through 3 (of 3 total)