+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Guru
    Join Date
    Apr 2011
    Location
    born in U.S.S.R.
    Posts
    1,742
    Thanks
    36
    Thanked 120 Times in 112 Posts

    FileOpen filtring multiple filetypes at once?

    Hello!

    I start to playing with scripting a little and already stuck in 2 questions.
    I want to make script for Indesign (i know that section is for PS but i think there is lots common) which place images one per page.
    (i googled a little on those question but didn't find normal answer)

    1. FileOpen with filter multiple filetypes at once. Like JPG, TIF etc. (images).
    Instead i find out how to separate them all ("*.jpg, *.tif") but want to be able select all image types file at one dialog.

    2. Creating new document.
    Yes, i find how to create in script new document with all needed parametrs but i really want to do that later, at moment when script are running.
    Does it makes sence?

    Mostly it planned to use to restore lost book layouts rescan (some are unreadble, some are not even archived, some are named so badly that finding it will be longer than restoring).
    So each book have diferent document size.


    3. And final for moment. Is that posible to record Indesign? Didn't find clear answer for that question too. That would make all things easier.
    Okey, find answer for that and not happy with it - NO! heh :(
    Last edited by SeniorS; 07-21-2011 at 06:11 PM.
    Rather than love, than money, than fame, give me truth. © Henry David Thoreau

  2. #2
    The Script Master
    Join Date
    May 2009
    Location
    Bradford,UK
    Posts
    208
    Thanks
    0
    Thanked 39 Times in 34 Posts

    Re: FileOpen filtring multiple filetypes at once?

    Getting all file type in one go is full of danger!

    Code:
    var myFolder = Folder("~/desktop");
    var fileList = myFolder.getFiles();
    alert(fileList.length);
    This will get you a list of all file and folders plus hidden files executables etc. etc
    This is why getting all files is not a good idea.
    this is much better as it will get a list of known photoshop files..
    Code:
    var myFolder = Folder("~/desktop");
    var fileList = myFolder.getFiles(/\.(jpg|jpe|jpeg|gif|eps|dng|bmp|tif|tiff|psd|crw|cr2|rle|dib|cin|dpx|ps|pcd|pict|vda|icb|vst|wbm|sct|pbm|flm|psb|exr|pcx|pdp|nef|dcr|dc2|erf|raf|orf|tga|mrw|mos|srf|pic|pct|pxr|pdd|pef|png|x3f|raw)$/i);
    alert(fileList.length);
    Sorry I don't do anything with Indesign so can't help with that.

  3. The Following User Says Thank You to Paul MR For This Useful Post:

    SeniorS (07-24-2011)

  4. #3
    Guru
    Join Date
    Apr 2011
    Location
    born in U.S.S.R.
    Posts
    1,742
    Thanks
    36
    Thanked 120 Times in 112 Posts

    Re: FileOpen filtring multiple filetypes at once?

    Oh...yes...thanks!

    I don't want all files select and i'm am aware of script danger so i'm very cautious.
    I couldn't figured out that "|" is for OR (and i really should quess that, now it looks obviously). Thanks again.
    Rather than love, than money, than fame, give me truth. © Henry David Thoreau

 

 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Powered by vBulletin® Version 4.1.9
Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.
Content Relevant URLs by vBSEO 3.6.0
Copyright 2011 Photoshop Gurus Forum. All rights reserved.
All times are GMT -5. The time now is 09:12 AM.
vBulletin Skins