How to preview the files in a specific folder?

Hi all!

Do for myself, a small tool. One of the functions is to show an overview of all files - in a scroll pane. How to display a file, that I already know and how to display all files?

The Script target InDesign, a few settings and it should work:

main();

function main() {
    var folder = Folder.selectDialog ("");
          var files = folder.getFiles();
          var imgs = new Array();
          for (var n = 0; n < files.length; n++)
                    if (files[n].name.search(/jpg$/i) != -1)
                              imgs.push( files[n].fullName );
          var sui_imgs = new Array();
          for (var n = 0; n < imgs.length; n++)
                    sui_imgs.push( ScriptUI.newImage( imgs[n] ) );

          var nr_of_rows = Math.floor( imgs.length / 4);

          var dlg =
                    "dialog {                                                                                                                         \
                              orientation: 'row',                                                                      \
                              alignChildren:['fill', 'fill'],\
                              pnl: Panel { preferredSize: [400,400], maximumSize: [400,400] },          \
                              scrl: Scrollbar { preferredSize: [20,400], minvalue: 0, maxvalue: "+ (nr_of_rows) + ", jumpdelta: 3, stepdelta: 1, value: 0  }          \
                              btns_grp: Group { \
                                        orientation: 'column', alignChildren: ['fill', 'top'],          \
                                        up: Button { text: 'up' },          \
                                        down: Button { text: 'down' }, \
                                        val: StaticText { text: '0' },          \
                                        cancel: Button {text: 'cancel', alignment: ['fill', 'bottom'] }          \
                                        }          \
                              }";
          var w = new Window(dlg);

          // Die IconButtons erzeugen
          var zeile, n = 0;
          var img_btns = new Array();
          for ( var y = 0; y < 4; y++) {
                    zeile = w.pnl.add("group");
                    zeile.orientation = "row";
                    for ( var x = 0; x < 4; x++) {
                              img_btns.push( zeile.add("iconButton",[undefined, undefined, 85, 85]) );
                              n++;
                    }
          }
          // Die Buttons für Rauf und Runter
          var shift = 0;
          fill_imgs( shift );
          w.btns_grp.up.onClick = function () {
                    shift = (shift > 0) ? shift-1 : 0;
                    fill_imgs(shift);
                    w.scrl.value = shift;
          }
          w.btns_grp.down.onClick = function () {
                    shift++ ;
                    fill_imgs(shift);
                    w.scrl.value = shift;
          }
          // Die Scrollbar
          w.scrl.onChange = function() {
                    shift = Math.round(this.value);
                    this.value = shift;
                    this.window.btns_grp.val.text = shift;
                    fill_imgs(shift);
          }

          w.show();

          alert( w.result );

          function fill_imgs( shift ) {
                    var btn_index, img_index;
                    for ( var y = 0; y < 4; y++) {
                                        for (var x = 0; x < 4 ; x++) {
                                                  btn_index = y * 4 + x;
                                                  img_index = shift * 4 + btn_index;
                                                  if (img_index < imgs.length) {
                                                            img_btns[ btn_index ].image = sui_imgs[ img_index ];
                                                            img_btns[ btn_index ].asset = imgs[ img_index ];
                                                            img_btns[ btn_index ].visible = true;
                                                            img_btns[ btn_index ].onClick = function () {
                                                                      this.window.result = this.asset;
                                                                      this.window.close();
                                                            }
                                                  } else {
                                                            img_btns[ btn_index ].visible = false;
                                                  }
                                        }
                    }
          }
}

See you soon,.

Davide

www.davidebarranca.com

Tags: Photoshop

Similar Questions

  • How to drag a file to a specific folder in Dreamweaver CS4

    In Dreamweaver CS4, everytime I try to drag a version recently put to date of a swf file in a certain directory / folder in the interface of Dreamweaver files Panel, the file just is under the root of my Web site instead.  I then have to manually drag in the right bin - where I give myself the option to replace the old copy.  It is followed by the question of whether or not I want to update the links that I move the file from the root in a specific folder.

    Is there a way to make the swf file directly (and often I deal with several) directly into his repertoire appropriate within the files Panel structure Dreamweave?

    Sometimes, when I dragged in several files (and possibly hold the CTRL key), files have been added directly where they belong - but this has been sporadic, so I don't really know the right method.

    Thanks for any help.

    (and as for version control, I use Tortoise SVN and have my Web site control files of version, but if I right click on one of these files in the Dreamweaver interface and select version control, all options are grayed out).

    Thank you

    In Dreamweaver CS4, everytime I try to drag a version recently put to date of a swf file in a certain directory / folder in the interface of Dreamweaver files Panel, the file just is under the root of my Web site instead.

    You drag the file from the STRANGER-DW (using the Explorer/Finder) and dropping it in the FILES of DW Panel (I think you can do it!)?  Or do you drag in the FILES Panel, but outside of your site (by choosing 'Local disk' in the drop-down list)?  I think what you see is the best you will get with this procedure.  Try to go to "Local Disk" and copy the file, then return to your site and paste it where you want.

  • (webutil) How to save the file in a specific way?

    Hello

    I have this part of the code
    Arglist := OLE2.Create_Arglist;
      OLE2.Add_Arg(Arglist,'c:\Export.xls');
      OLE2.Invoke(workbook, 'SaveAs', Arglist);
      OLE2.Destroy_Arglist(Arglist);
      -- release workbook
      OLE2.Release_Obj(workbook);
      OLE2.Release_Obj(workbooks);
      OLE2.Release_Obj(application);
    who saves the excel C:\Export.xls file. I tried to open a file save dialog box, with
    BEGIN
               
      file_name_cl := CLIENT_GET_FILE_NAME('C:\Export', 'ExportExcel.xls', 'XLS Files (.xls)|*.xls|', NULL, SAVE_FILE, TRUE);
      file_name_cl := SUBSTR(file_name_cl,1,LENGTH(file_name_cl));
      --
      IF file_name_cl IS NULL THEN
         MESSAGE('INSIDE EXCEPTION STATEMENT');
         RAISE user_cancel;
      END IF;
    {code]
    
    But the file isn't saved. Why?
    
    So here is all the code
    PROCEDURE export_din_datablock (p_block varchar2) is

    REQUEST OLE2. OBJ_TYPE;
    WORKBOOKS OLE2. OBJ_TYPE;
    WORKBOOK OLE2. OBJ_TYPE;
    SPREADSHEETS OLE2. OBJ_TYPE;
    WORKSHEET OLE2. OBJ_TYPE;
    Arglist OLE2. LIST_TYPE;
    CELL OLE2. OBJ_TYPE;
    J INTEGER;
    INTEGER K;
    file_name_cl VARCHAR2 (32767).
    USER_CANCEL EXCEPTION;
    Workfont OLE2. OBJ_TYPE;
    WorkInterior OLE2. OBJ_TYPE;
    m_item varchar2 (40);
    m_tot_columns number: = 0;
    LC$ target Varchar2 (256): = "text.xls";
    LC$ Fic Varchar2 (256);

    -Inner Proc.
    Procedure put_cell (number of no_lig,
    Number of Col_num,
    put_value varchar2,
    FONT_NAME varchar2 default null,
    font_size directory by default null,
    font_style varchar2 default null, - we can use pune "BOLD" pentru "BOLD", "ITALIC" pentru italics, etc.
    font_color directory by default null) is
    Begin
    Arglist: = OLE2.create_arglist;
    OLE2.add_arg (arglist, row_num);
    OLE2.add_arg (arglist, col_num);
    cell: = OLE2.get_obj_property (Worksheet, 'Cells', Arglist);
    OLE2.destroy_arglist (arglist);
    OLE2.set_property (Cell, 'Value', put_value);

    Workfont: = OLE2.get_obj_property (cell, 'Make');
    WorkInterior: = OLE2.get_obj_property (cell, 'Interior');
    If font_name is not null then
    OLE2.set_property (Workfont, 'Name', FONT_NAME);
    End if;
    If font_size is not null then
    OLE2.set_property (Workfont, 'Size', font_size);
    End if;
    If font_style is not null then
    OLE2.set_property (Workfont, font_style, 1);
    End if;
    If font_color is not null then
    OLE2.set_property (Workfont, font_color 'ColorIndex');
    End if;
    OLE2.release_obj (workfont);
    OLE2.release_obj (workinterior);
    OLE2.release_obj (cell);
    End;


    BEGIN

    file_name_cl: = CLIENT_GET_FILE_NAME ('C:\Export', 'ExportExcel.xls', ' file XLS (.xls) | * .xls |', NULL, SAVE_FILE, TRUE);
    file_name_cl: = SUBSTR (file_name_cl, 1, LENGTH (file_name_cl));
    --
    IF file_name_cl IS NULL THEN
    MESSAGE ("INSIDE THE EXCEPTION STATEMENT");
    RAISE user_cancel;
    END IF;

    APPLICATION: = OLE2. CREATE_OBJ ('Excel.Application');
    OLE2. SET_PROPERTY (application, 'Visible', true);

    WORKBOOKS: = OLE2. GET_OBJ_PROPERTY (APPLICATION, 'NOTEBOOKS');
    WORKBOOK: = OLE2. INVOKE_OBJ (WORKBOOKS, "ADD");
    WORKSHEETS: = OLE2. GET_OBJ_PROPERTY (WORKBOOK, 'WORKSHEETS');
    WORKSHEET: = OLE2. INVOKE_OBJ (SPREADSHEETS, "ADD");
    OLE2.set_property (spreadsheet, 'Name', 'leaf-ul meu');

    GO_BLOCK (p_block);
    PREMIER_ENREGISTREMENT;
    -prima linie dedicated numelui sunt; pe linia incep 2.
    J: = 2;
    K: = 1;
    LOOP
    m_item: = get_block_property (p_block, first_item);
    K: = 1;
    Loop
    exit in M_ITEM IS NULL;
    If not id_null (find_item (p_block |'.)) ' || m_item)) then
    -daca point-urile sunt type specificat (+ eventual alte conditii), atunci to export data din ele
    If get_item_property (p_block |'.) ' || m_item, item_type) IN ('ELEMENT of TEXT', 'VIEW ARTICLES', 'LIST', 'CHECKBOX')
    and get_item_property (p_block |'.) ' || m_item, visible) = "TRUE" then
    If j = 2 then
    -preiau dinamic name if sunt afisez pe linia 1, cu "BOLD"
    put_cell (1, k, get_item_property (p_block |'.)) ' || m_item, column_name), null, null, 'FAT');
    end if;
    If not name_in (p_block |'.) ' || m_item) is NULL then
    -data afisez
    put_cell (j, k, name_in (p_block |'.)) ' || m_item));
    End If;
    K: = k + 1;
    end if;
    end if;
    -merg urmatoarea inregistrare
    m_item: = get_item_property (p_block |'.) ' || m_item, NEXTITEM);
    END LOOP;
    J: = J + 1;
    When the output: system.last_record = "TRUE";
    NEXT_RECORD;
    END LOOP;
    OLE2. Release_Obj (Worksheet);
    OLE2. Release_Obj (Worksheets);
    -Save the created Excel file
    Arglist: = OLE2. Create_Arglist;
    OLE2. Add_Arg (arglist, 'c:\export.xls');
    OLE2. Invoke (Binder, 'SaveAs', Arglist);
    OLE2. Destroy_Arglist (arglist);
    -Release of workbook
    OLE2. Release_Obj (Workbook);
    OLE2. Release_Obj (Workbooks);
    OLE2. Release_Obj (application);
    MESSAGE ("Export cu success!'");
    END;
    Please help.
    Thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

    Roger

    Not to be confused... YOU read my previous POST.

    Also answer me...
    How do you want to save the file?
    1. replace or add to the file in the folder?
    2. create a new file in the folder?

    If you answer is first, change your code in a more dynamic way

    -Save the opened Excel file
    rglist: = OLE2. Create_Arglist;
    OLE2. Add_Arg (arglist, file_name_cl);
    OLE2. Invoke (Binder, 'SaveAs', Arglist);
    OLE2. Destroy_Arglist (arglist);

    So then you can give it

    -Save the created Excel file
    rglist: = OLE2. Create_Arglist;
    OLE2. Add_Arg(arglist,'c:\export\newexcelexport.xls');
    OLE2. Invoke (Binder, 'SaveAs', Arglist);
    OLE2. Destroy_Arglist (arglist);
    Your file will be saved in the "C:\export\" a folder with the name newexcelexport

  • How to transfer files to a specific folder (or root) instead of the Assets folder?

    Is it possible, or should I go ahead and fill a feature request?

    Hello

    You can set a folder so that the download site and the full site will be downloaded to this folder. However, it is not possible to download a particular file in a specific folder.

    Kind regards

    Aish

  • How to delete the files from my HP ePrint app after download / print?

    Can someone tell me how to delete the files from my HP ePrint app after that I downloaded and printed. Thank you

    jmsandkds,

    I apologize for the confusion. Options you speak of "photos, web and file" are located on the phone somewhere, lets say you click files. When you click on files, it will search the phone for available files that are able to print the ePrint app. To the extent where they are on the phone, you will need to search for them via the search screen, connection to the computer, or some files are program specific and only available in this program to be read, edited, or deleted.

    I hope this helps.

  • I can't access the files under a specific user name, no password

    original title: access files

    Received the infamous "blue screen" error  Installed new hard drive and Windows XP Pro.  Installed old drive "blue screen" in a "pregnant" so I could access the files.  Only problem is that I can't access the files under a specific user name, no password.  All of the suggestions.

    In a situation like yours, you need to "Take Ownership" files that you can access on your old disk:

    "How appropriate a file or a folder in Windows XP"
      <>http://support.Microsoft.com/kb/308421 >

    HTH,
    JW

  • How to move the FILE from one place to another and keep "Indexing" have to move to the unknown location so you can't discover its full file path? Windows instructions provide information wrong re: how to do this!

    Make a bunch of audio files, placed in a folder on my desktop. Files initially sent to RealPlayer to burn, but when finished burning CD and went to read a CD, folder got seized by Media Player, 'Indexed' and disappeared from the office. I'm a relatively new computer user, and I need to learn more about file paths, how to view the path FULL of a file on my computer and how to type (create) full path when I need to. The "Indexing" feature seems to erase this lesson for me, and after having spent four hours trying to find Vista instructions on "How to move the file from one place to another", I gave up! Windows 'Help and Support' on my computer gives wrong directions. It states that if I right click on a folder > properties, a dialog box opens with a tab by which I can move my account. There is no tab location here. I found locations tab when right click on the "Mobile" folder, but still no option to "move file". No idea what is the folder "Roaming" or why it's on my computer. I want my audio files in the My Music folder, but this place is "access denied." Don't know how to get the audio file it in any case, but if anyone has any advice, I would be very happy! Thank you. PS - I had no problem moving folders in XP. I don't like the idea that a computer is to decide where to put my files. I want to control where I put my files. I don't like the way search works under Vista. I liked the XP search companion better because, for a computer fool like me, it was really easy to organize and find files and folders and had an option specific to find audio and video file TYPES.

    Here is an article on how to move your personal folders in Vista: http://www.howtogeek.com/howto/windows-vista/moving-your-personal-data-folders-in-windows-vista-the-easy-way/.  If you're talking about the special folders (such as photos, Documents, office...), then here is an article on how to move: http://www.winhelponline.com/articles/95/1/How-to-move-the-special-folders-in-Windows-Vista.html.

    If you have trouble with the search after you move the files, then rebuild the index: http://www.tech-recipes.com/rx/2103/vista_rebuilding_the_search_index/.  Here is an article on how to use Indexing Options in Vista that may be useful for you: http://www.vistax64.com/tutorials/69581-indexing-options.html.

    If the above does not help, your problem seems to relate to the image of the files/folders and their interactions with Media Center (which operate on different other folders).  Please repost your question in images and video Forum at: http://social.answers.microsoft.com/Forums/en-US/vistapictures/threads where the people who specialize in issues of the image will be more than happy to help you with your quesitons.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • VM simulator - how to access the file system.

    I was wondering if anyone knows how to access the file vmware playbook simulator system.

    I don't want access programmatically, I covered, for access to the file system to copy files to the Simulator in shared directories.

    When you connect a playbook on the USB, it shows up as a drive, and I would like access to the same playbook vm dir structure to copy files for testing. for example if your s app access the pictures on the camera, I would like to copy some images for the test. Any ideas?

    TIA - dave

    Search the forum for more information on using 'ssh' to access the Simulator and more specifically help 'scp' or 'sftp' to transfer files to. You will do this in the files under/accounts/1000/shared, and if you're on Windows you will probably be to install PuTTY to do this. Feel free to ask for help more once you have dug through it all.

  • How to decompress the files downloaded for use with Windows 7?

    How to decompress the files downloaded for use with Windows 7.  Specifically, zip files are a Magellan GPS unit.

    There are instructions at: http://windows.microsoft.com/en-us/windows7/compress-and-uncompress-files-zip-files

  • How to read the files on time capsule

    How to read the files on time capsule from iPad?

    Thank you

    Using an application like navigation on the iPad. More info here:

    Stratospherix - FileBrowser - overview

  • Anyone know how to sort the files in windows 7.

    Anyone know how to sort the files in windows 7. All of a sudden my file says "a long..., there is this month...» Last week... today. I can't deal with all the files in the folder now. How can I keep rid of one a long time ago..., this month... Last week... today) so that I can fix the whole folder?

    Hello

    Right-click on an empty area of the concerned window, select Group By, and then select None.

    Best wishes

    DP - K

  • How to reinstall the file MSVC90.dll

    My computer cannot read the real player as it says im lack the file above. some can guide me on how to reinstall the file.

    Hi tonyuniformat


    You have Microsoft Visual C++ 2008 installed on the computer?


    Method 1:

    You can try to reinstall the program and check if that helps.

     

    Method 2:

    If the problem persists you can check if you install Microsoft visual C++ 2008 helps that solve you the problem. Refer to the below link to install the same.

    http://www.Microsoft.com/downloads/en/details.aspx?FamilyId=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en

     

    I hope this helps.

  • Windows 8, 32-bit: how to cancel the file history and use the USB for the sole purpose Ready Boost

    By mistake, I clicked file history on. The USB key used for ready boost is selected and that the disk is write protected. Windows 8, 32-bit: how to cancel the file history and use the USB for the sole purpose Ready Boost. I don't have an another USB suitable for ready boost.

    Hello

    You should be able to disable the history of files by using the local Group Policy Editor.  Consult this publication of the article.  Use the #2 option.

  • Reinstalled Vista on my Gateway computer. There are 2 users, how to find the files saved by Windows before reinstalling?

    My C drive was blue screens so that I couldn't get into my computer and it became useless. I'm a total computer not so smart person, (politically correct too) :) In any case, after finding how to get in safe mode and fishing around a solution, I got the solution from scratch. It was April, which should give you an idea how well informed, I am when it comes to such things.

    So I took the option that would save all user files before reinstaling the operating system which is original bought the 2008 version. Vista 32-bit. Yes I know it's old but it works again. So since then I tried to get it updated and secure. Gateway won't help me at all, of course, out of warranty and all. So I downloaded the service Pack 1 and 2 for vista and all the security updates and Microsoft security essentials and IE9. So now I'm finally back to normal, which I think is a relative term.

    So now, I want to find all the files of the user who have been registered by windows before the reinstall took place. My folders and files from my sister. Treatment of text and pictures and stuff.

    Once I found how to make their return to where I am and where it is?

    You are welcome.

    Unfortunately, you have not yet told how you have saved the files.

    If you used the Auromatic backup gateway, they say that the files are in the C:\Backup folder on the hard drive.

    You will need to open that folder and either copy and paste or drag and drop them where you want them to be.

    It's a question you'd have to ask Gateway:

    http://support.gateway.com/support/ask_gateway.aspx

    .

    If you sustained yourself using Vista DVD files or an external hard drive, is how do to the files from the point upwards.

    "How to restore your files.

    http://www.wintuts.com/how-to-restore-files

    See you soon.

  • Have deleted implementing up-to-date, but while they inspected I think it's still in my system in my history how to find the files to remove it completely?

    Original title: Remove KB3035583

    I deleted the update, but while they were inspecting it, I think it's still in my system in my history how to find the files to remove it completely?

    I am running Windows 7

    Microsoft have now updated the status of GWX, whenever changes to update is downloaded as a new update re. It is not beyond their intrigues to GWX ineffective as well. Unfortunately we have to be patient until 29 July when, according to the assurances of Microsoft this mess will be disabled. I don't know if there is code to turn it off or we wanted yet another update to do.

Maybe you are looking for