User alert at points outside the table in Extendscript

I have a script that checks a folder for the files contained in a table format image.

I have to be able to warn the user if:

  1. a folder they choose contain any type of file not included in the table (illegal file type).
  2. the folder they choose more than one file type included in the table (mixed types of legal files).

or

  1. the folder they choose contains any type of file, not in the table more one type of file that is in the table (mix of types of illegal & legal files).

Here's the code that checks through a folder for certain types of files.

var DARKfileList = [], FILE_TYPE, FTlen, i, SEARCH_MASK;
FILE_TYPE = ["orf", "tif", "tiff", "jpg", "jpeg"];
FTlen = FILE_TYPE.length;
for (i = 0; i < FTlen; i++) {
    SEARCH_MASK = "*." + FILE_TYPE[i];
    DARKfileList = DARKfileList.concat(DARKinputFolder.getFiles(SEARCH_MASK));
}
alert('found: ' + DARKfileList.length + ' files');

For now I have sort of reached part 1 but it is messy because it simply checks if DARKfileList is empty. Can I use this to alert the user that the file that they choose in a vacuum, but I would much prefer another search for "types of illegal files" it's checking the empty list:

if (DARKfileList.length == 0)
{
    alert('Folder does not contain allowed file types!','DARK FRAME folder error');
} 

Kind regards..

It's weird, it was not the subfolder thing this morning, when I tried, but I added a few lines to make sure that the files are only of the parent folder.

#target photoshop

var fileTypes = ['TIF', 'TIFF', 'JPG', 'JPEG','PSD','RAF'];//keep uppercase
var allFiles = new Array()
var fileList = new Array();
var legalTypes = new Array();
var illegalTypes = new Array();
var folderToUse = Folder.selectDialog ('Select a folder');
var searchMask = '*.???*'
allFiles = folderToUse.getFiles(searchMask);
for(var i = 0;i1&& illegalTypes.length ==0){alert('More than one legal file types.\nNo illegal file types.')}
if(legalTypes.length==1&& illegalTypes.length > 0){alert('only one legal file type.\nContains illegal file types.')}
if(legalTypes.length>1&& illegalTypes.length > 0){alert('More than one legal file type.\nContains illegal file types.')}
if(legalTypes.length==0 && illegalTypes.length > 0){alert('No legal file types.\nContains illegal file types.')}

function checkFiles(fileArray){
    if(fileArray.length>0){
        for(var i =0;i 
         

Tags: Photoshop

Similar Questions

  • Text in tables is rough, while the text outside the table is clear

    Hey,.

    I am designing a Web site, I use tables to organize my work/design. However whenever I type text in my table is rough and very unattractive. While the text I type outside the table is perfectly crisp and clear.

    Could someone tell me what I am doing wrong? Or an alternative?

    Here is a picture showing my problem, the picture would be text at the bottom of the image.

    http://img696.imageshack.us/i/roughtext.jpg/

    With the help of:

    Adobe Dreamweaver CS4

    nicknackhack wrote:

    It seems that this could be it, but how to fix it?

    Thank you for your response so

    Change of the to

    When you insert a table on your page, you are presented with the option to use (table headers). If you do not want to use them do not select this option.

  • Apply the Style to the table using Extendscript CC cell text

    Hello

    I have the following code. I try to scan a document and a specific keyword research based on the regex. That part works. I then get the range of text for those keywords and the highlighted text. This method works. What does not work, it is when I try to do the same in the text that is in a table cell.

    #target framemaker
    
    var doc = app.ActiveDoc;
    var totalPgfs = 0;
    
    var pgf = doc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;
    
    function do_table_work(pgf){
        var result = pgf.GetText(Constants.FTI_TblAnchor);
        var all_text = '';
        for (var i = 0; i < result.length; i += 1) {
            var t_object = result[i].obj;
            var t_cell = t_object.FirstRowInTbl.FirstCellInRow;
            while(t_cell.ObjectValid()){
                var cell_items = t_cell.GetText(Constants.FTI_String);
                var tr = new TextRange();
                 tr.beg.obj = tr.end.obj = pgf;
    
    
                 tr.beg.offset = 0; //this is built dynamically
                 tr.end.offset = 7; //this is built dynamically
    
                apply_char_format(text_range)
                t_cell = t_cell.NextCellInTbl;
            }
        }
    }
    
    function apply_char_format(text_range, name) {
        var color = doc.GetNamedColor(name);
        if (color.ObjectValid()) {
            var set_val = new TypedVal();
            set_val.valType = Constants.FT_Integer;
            set_val.ival = true;
            doc.SetTextVal(text_range, Constants.FP_UseBkColor, set_val);
    
    
            set_val.valType = Constants.FT_Id;
            set_val.obj = color;
            doc.SetTextVal(text_range, Constants.FP_BkColor, set_val);
        } else {
            alert('Color does not exist');
        }
    }
    
    while (pgf.ObjectValid()) {
        do_table_work(pgf);
        pgf = pgf.NextPgfInFlow;
    }
    

    The problem is that it is not highlighting the text in the table cell as I want it. If I process the document and use the following syntax:

    var result = pgf.GetText(Constants.FTI_String);
    

    It will highlight the text (with extra code to loop through these results).

    Any thoughts on what I'm missing?

    Hi Green,

    I don't have time to debug this script completely, but I see things that seem unusual.

    1. var result is TFP. GetText (Constants.FTI_TblAnchor);
    2. var all_text = ";
    3. for (var i = 0; i)< result.length;="" i="" +="1)">
    4. var t_object = .obj result [i];
    5. var t_cell is t_object. FirstRowInTbl.FirstCellInRow;
    6. While (t_cell. {ObjectValid()})
    7. var cell_items is t_cell. GetText (Constants.FTI_String);
    8. var b = new TextRange();
    9. TR. Beg.obj = tr.end.obj = bmp;

    GetText() is valid for a table cell, I don't know if that's what you want. I think I want to explore the individual paragraphs. I'm not quite clear on what this code does do exactly, but it seems that this would make it much easier to implement the text ranges. GetText() will cover all the paragraphs in a cell, if there are several.

    Added to this, your line "tr.beg.obj = tr.end.obj = bmp;" makes no sense to me, because you're coming back the paragraph which contained the anchor point of the table. In other words, you just leave the table entirely.

    So it's just a few riddles, but it seems more likely that you would something along these lines:

    1. var t_cell is t_object. FirstRowInTbl.FirstCellInRow;
    2. While (t_cell. {ObjectValid()})
    3. var cellPgf is t_cell. FirstPgf;
    4. var cell_items = cellPgf.GetText (Constants.FTI_String);
    5. var b = new TextRange();
    6. TR. Beg.obj = tr.end.obj = cellPgf;

    Hope this helps some.

    Russ

  • Diagram of authentication with user name / password stored in the Table of the App

    Hi all

    So far, all of our applications have used sign-ON, but I have now spread to allow users from outside of our Organization (and so not in our system OID) to use a specific application.

    So, I have a table in my application that stores the user name and password. I have a function that compares the input of user name and password at this table and returns a Boolean result. This function is then entered in my scheme of authentication as the authentication function.

    This works well and is causing no problem. The problem is that the password is stored and verified to plain text - not very good lie.

    How can I do to change the password of my table column, pages which allow the password to be updated, and authentication which checks the user name / password to use a form of encryption?

    Also, do I need to worry about all the other fields (Page Sentry function to check the authentication session, prerequisite process etc.) that the authentication scheme can offer me - or can I just leave these virgins as they are now.

    If someone can give me a complete "out-of-the-box" solution that would be wonderful - otherwise a good hard pusj in the right direction would be much appreciated.

    Thank you very much
    Martin

    Hello Martin,

    If you discover here the application of Discussion Board, you should find the information you need. This application stores an encrypted version of the password of the user in the table.

    http://www.Oracle.com/technology/products/database/application_express/packaged_apps/packaged_apps.html#Forum

    Good luck
    Don.

    You can reward this answer by marking as being useful or correct :)

  • How to store data points in the table

    I'm new to labview and I am trying to store the output of the frequency of 'measures pulsed VI' in a table, add everything together and divide by the length of the array. I don't want a table of numbers to be shown on the indicator. Just average 25 numbers.

    Basically, I want to do, but in labview.

    arrayIndex = 0;

    for (int i = 0; i)<=25;>

    {

    NewData = somedata;

    MyArray [arrayIndex] = newdata;

    dataAvg = dataAvg + myArray [arrayIndex];

    arrayIndex ++;

    }

    dataAvg = dataAvg / 25;

    I have attached my attempt, but its probably a very poor attempt. (The N on my first loop for was 25 when I tried to run the VI)

    Thanks in advance

    You need n number of bed DAQmx to take the average of the number n of steps of the pulse. Silly to take 500 what whatsoever when you have a single DAQmx reading which returns a single measure. As I said, you can use a registry to offset or point-by-point inside the loop. Or, run a number n of the acquisition of times with a loop and moves the pulse measurement in the table for automatic indexing and calculate an average, when all acquisitions are made.

  • User alert registration PDF if the required fields are empty/null

    Greetings,

    I read a lot of threads on this topic. I'm not trying to force the user to stay in one area or otherwise, be annoyed. I would like to just draw the attention of the user when they record the PDF file if there are mandatory fields have not been completed. The alert message would simply be a reminder polite form before sending.

    I use Acrobat Pro XI.

    (1) is the other tasks/Set Document Actions / Document will save the right place to use a script in this case?

    (2) the script will check each field required name? Or is it possible to reference all the fields requested in the document?

    (3) I have seen a few examples like this:

    f = getField (event.target.name)

    If (f.value.length == 0)

    {

    f.setFocus)

    App.Alert ("this field is required. Please enter a value. »)

    }

    However there are some problems regarding the closure of the alert dialog box and so on. Can someone provide an example script to help me get started?

    Thank you!

    Exactly how you check a field is empty depends on what kind of field it is. For text fields, you must get the value of the field as a string and compare it to an empty string, something like:

    var val = getField("Text1").valueAsString;

    If {(val)

    App.Alert ("field is not empty");

    }

    If there is a default value that needs to be changed, you would compare it to the default value:

    var f = getField ("Text1");

    var val = f.valueAsString;

    If (val! == f.defaultValue) {}

    App.Alert ("field value is OK");

    }

    For checkboxes and radio buttons, you would compare it to the string "Off", which means that none in the group is selected.

    For drop-down lists (combo boxes) and list boxes, there is normally a single value selected, so you should get the value and check the default value (or something else) to see if the field is filled in correctly.

    You could place the script it, but I usually use a separate button that I encourage the user to click to activate the check box. The problem with the help of her saving the event is that you cannot stop the backup.

    The script can loop through all of the fields (and test all zeros required), or you can define an array of domain names to check.

  • Add the header of each subsequent page outside the table

    I'm working on a report and when a new page is needed for the VP he is grouped on, it does not print their name on the top of the next page. It is not part of the table that is a nested group. How I'd get their name to repeat at the top of each page?

    Group by VPNAME VPNAME line
    Incumbents name holders temporary replacement Long term replacement job title preparation risk of turnover
    G INCUMBENTTITLE G INCUMBENTNAME F E.SEQNUM) TEMPNAME A.SEQNUM) LONGTERMNAME LONGTERMTITLE A.ZHR_READINESS RETENTIONRISK E

    E

    E


    line breakend page by VPNAME

    drpp you're model with xml to my profile ID.

    Ideally, you should have
    and not the xsl code.

  • graphic positioning anchored outside the table

    I have a table of single cell with a small graphic which is anchored so that it is positioned to the left of the table and the Libya in the field of the margin. The reason why the chart cannot be in a table cell is because he has to the protrusion in the margin beyond the text frame.

    The table is inserted periodically throughout several documents. The lines of text in the table can vary - sometimes it will be 1, 2, 3 lines of text in the cell.

    I need to have the rooted graph centered vertically to the left of the text in the cell - the distance of 'y' for the embedded chart varies according to the number of rows in the table cell. Is there a way to automatically center the graph so that it does not need to be positioned manually for each table?

    Jay, the definition of the paragraph that the table is to right-alignment has nothing to the text in the cells. Try it: make the table larger than your image, then select the entire table, including the paragraph back, using the text tool, then set it to center alignment (it'll stick both sides), then to the right (it'll stick to the left, 'out' in the margin).

    (If I remember correctly, that is.)

  • Flash paper is displayed outside the Table

    I'm sure this has smething like object tags and the upgrade of IE, but I can't understand it! I have a Flash Paper content that should appear in the center of the page. It very well in FireFox, but in IE, it appears off the table in the lower left corner. What I need to change so that IE will see correctly? Other paper Flash site pages appear fine in IE. What is the problem with this page?

    Flash "> http://www.ohiowestie.com/club_newsletter.html [L = Flash page paper problem]"

    Just fixed it, but I do not remember how! I found a line of additional script code in the HEAD and deleted. That seemed to do the trick, but I not save the code to be able to post here. Sorry!

  • Where the owb user information is stored in the tables

    Hi all

    I use repository OWB 10.2.0.4.0. I need to know where the user OWB information are stored in Physical repository tables.

    Please help me with this?

    You can consult the following queries

    1. Select the owner from dba_objects where object_name = 'ALL_IV_INSTALLATIONS' and owner not in ('PUBLIC');

    2. select separate beneficiary, substr(granted_role,5,25)
    of dba_role_privs
    where substr (granted_role, 1, 4) = "OWB_".
    and substr(granted_role,1,6) not in ('OWB_D_', 'OWB_O_', 'OWB_A_', 'OWBR_')
    and default_role = 'NO '.
    and admin_option = 'NO ';

    Thank you
    Fati

  • Manipulation of the table with the recurrence

    I have a 2D chart which is similar to an adjacency matrix.  The table contains information that I need to analyze following a set of simple rules, but I'm unable to implement them.  Here is a simple example of the table (I would like to get the simple example job, and then expand as needed to work with the greatest examples).  The table is a table of 6 x 6 and the columns contain information about a procedure of transition between nodes in a map.  There is a root column (column we will begin by) and there are sheet columns, columns, we strive to achieve by browsing through other nodes in the graph (other columns in the table).  In the example below there is that a single root and a leaf, root is column zero and the leaf column 6 (I chose the marking of the nodes so that the zero column would be the root and column 6 would be the leaf but it doesn't have to be the case and I'm writing the software so that it is not dependent on the labelling of the map).  Outside the entrance to 2D table, there will be an array of column headers that maps the label of node to the right column of the table, a table of leaves and a digital control for the root.  That's what I try to do, refer to the image below.

    I look at the root and see that this is node 1, the column header looking I see that node 1 is column zero of my table.  I start with the line 0 in column 0 (the root column) and work my way down looking for integers not dummies.  I'm a rank, then see the integer 2, that tells me that I need to move the column 1 of the table (because the column 2 header) and store the integer 2.   I start with row 0 column and work my way down looking for integers not dummies.  I just rank 2 and see integer 3, that tells me that I have to move to column 2 of the table (column 2 header 3) and store the integer 3 (while I now [1,2,3] as my path I'll build).  I start at line 0 in column 2 and work my way down looking for integers no dummies and come in the 4th row is Integer 5, it tells me that I have to move to column 4 of the table (because the column 4 has 5 header) and store the integer while I [1,2,3,5] as my way.  I start at line 0 in column four and work my way down looking for an integer not null and come 5th see 6, because integer integer 6 is my current journal (only sheet for this example) I stop and have a path from node 1 to node 6 [1,2,3,5,6].  I didn't even though (and this is the part that gives me bad) because the column 1 (node 2 header) had another line nonzero, rank 3, which contains integer 4.  I need to repeat the process from here, give me a second track of [1,2,4,5,6].

    You can see how this will get very complex when I have several columns with several lines non-zero.  This seems to be a good case for use recursion, but I can't write the code to do this.  In the end, I need to find all the ways to get from the root to the leaf, as I said that there is more than one sheet in most of the cases.  Having many Leafs should not be a problem because I can repeat the same process for each leaf.  I have attaced a VI in 8.0 which has berries that I work with, according to the picture above.  I would like ideas on how to achieve this, as I refuse to do it by hand for great examples when I should be able to easily automate this process.

    Concerning

    This version fixes two problems I mentioned - one was caused by the queues the starting point outside the loop (a legacy of my original idea), the other to not deal with the final loop iteration when there is nothing in the queue (fixed with an additional business structure).  You need is a graph (that is to say, have links back and forward)?  Otherwise you could do a little more efficient with a directed graph, by removing the link from 2 to 1, 3 and 4 to 2, etc.

  • Build the name of guard of the table of the last element, but not the others. Workaround solution?

    Hello

    Sorry if this has been posted before, I did the search first, but can't find anything.

    Problem is that I have two configurations which are identical and must be ordered by a single vi. Given that they are the same, they are configured with the same sets of parameters so I decided to create a cluster of these and then build an array of clusters. In this way I need to use only a thread and if I need a given parameter I can get it easily from here (or so I thought) and also because I need to see if anything changes I can compare a thread instead of each of the parameters.

    The gui has the list of parameters, then in the block diagram I group them appropiately, using "Bundle name" and then each bundle in a table by using "build the table. Problem is when I have the index in the array for the first place of the configuration and usage to unbundle the parameters I need, using "ungroup by name" (although if I use "Unbundle" the same thing happens) and lo and behol, the output names come from the configuration of the second, not the first.

    Here's the curious thing, though, even if the names are all wrong, that the values are correct. I could live with that, but it's more boring it will be another very difficult user to understand the schema more this is just a proof of principle to test with two, eventually there will be eight or more and who's going to get really confusing.

    Is there a way to get around this? Even if it is to change the names after unbundling.

    Check the attached vi to see what I mean.

    I think you forget an important point on the tables.  The only thing that may be different between each element of a table is its value.  The elements in the array must all share the same properties.  This would therefore include the names of the different elements that make up the cluster that is a table element.

    It seems that the last group that builds in the table is the one that defines the names of the items that are in the element of the cluster.  You must give all elements of the array with the same name within the cluster.  Or use a cluster of clusters rather than a table of cluster to create your data structure.

  • Select the row in the table to change in a form

    Hi all

    I use Jdeveloper 12.1.3.0.0 on windows internet explore 10.

    I have the following form and the read-only table. the form and the table that are both on the same object from view.

    click_edit.png

    When the user clicks a row in the table, I want to choose this line in the form above for editing purpose.

    How would I do that? the first column of the table is a primary key.

    I followed shayjdev vedio http://www.youtube.com/watch?v=e0IcnXLJUgU

    but the problem is that when I click the button CreateInsert (5th button left in my case), never clear the form for the opening of new record, instead, he put the table in input mode.

    kindly help me with this.

    Thank you.

    To create a new line, you drag the operation createInsert of the data control on the create new"" button. This should create the new row.  If you like the new line being the last of them using the link from dvohra21 to https://blogs.oracle.com/jdevotnharvest/entry/how_to_add_new_adf

    In this case, you must change the listener to the button action to point to the generation of listener action code of Frank.

    Timo

  • Insert the data in materialized views at the Table

    Hello

    We have a problem in which some incorrect data has been loaded for tables.

    Users now are pointing to the materialized views and data access using synonyms.

    Is it possible to insert data from a view, materialized at the tables?

    Kind regards

    VN

    Hello

    As sb92075 has said, we can insert in the table of the materialized view.

    Test below data:

    SQL > select * from t1;

    CITY OF AMOUNT ID COMMENTS

    ---------- -------------------- ---------- --------------------

    1 XXX 28 Chicago

    2 AAA LAS 25

    3 YYY 25 NY

    4 35 Texas XXX

    5 XXX 55 Arlington

    6 56 Chicago YYY

    7 XXX 66 NY

    7 selected lines.

    SQL > create mv_t1 view materialized in select * from t1;

    Materialized view created.

    SQL > select * from mv_t1;

    CITY OF AMOUNT ID COMMENTS

    ---------- -------------------- ---------- --------------------

    1 XXX 28 Chicago

    2 AAA LAS 25

    3 YYY 25 NY

    4 35 Texas XXX

    5 XXX 55 Arlington

    6 56 Chicago YYY

    7 XXX 66 NY

    7 selected lines.

    SQL > insert into t1 values(8,'BBB',22,'NY');

    1 line of creation.

    SQL > select * from mv_t1;

    CITY OF AMOUNT ID COMMENTS

    ---------- -------------------- ---------- --------------------

    1 XXX 28 Chicago

    2 AAA LAS 25

    3 YYY 25 NY

    4 35 Texas XXX

    5 XXX 55 Arlington

    6 56 Chicago YYY

    7 XXX 66 NY

    7 selected lines.

    SQL > select * from t1;

    CITY OF AMOUNT ID COMMENTS

    ---------- -------------------- ---------- --------------------

    1 XXX 28 Chicago

    2 AAA LAS 25

    3 YYY 25 NY

    4 35 Texas XXX

    5 XXX 55 Arlington

    6 56 Chicago YYY

    7 XXX 66 NY

    NEW YORK 8 22 BBB

    8 selected lines.

    SQL > commit;

    Validation complete.

    SQL > select * from mv_t1;

    CITY OF AMOUNT ID COMMENTS

    ---------- -------------------- ---------- --------------------

    1 XXX 28 Chicago

    2 AAA LAS 25

    3 YYY 25 NY

    4 35 Texas XXX

    5 XXX 55 Arlington

    6 56 Chicago YYY

    7 XXX 66 NY

    7 selected lines.

    SQL > delete from t1;

    8 deleted rows.

    SQL > select * from mv_t1;

    CITY OF AMOUNT ID COMMENTS

    ---------- -------------------- ---------- --------------------

    1 XXX 28 Chicago

    2 AAA LAS 25

    3 YYY 25 NY

    4 35 Texas XXX

    5 XXX 55 Arlington

    6 56 Chicago YYY

    7 XXX 66 NY

    7 selected lines.

    SQL > insert into t1 select * from mv_t1;

    7 lines were created.

    SQL > select * from t1;

    CITY OF AMOUNT ID COMMENTS

    ---------- -------------------- ---------- --------------------

    1 XXX 28 Chicago

    2 AAA LAS 25

    3 YYY 25 NY

    4 35 Texas XXX

    5 XXX 55 Arlington

    6 56 Chicago YYY

    7 XXX 66 NY

    7 selected lines.

    SQL >

  • Strange behavior of the cursor to the row in the table

    Hello.

    I use JD Studio Edition Version 11.1.1.5.0 on Weblogic 11.1.1.5

    I have page JSPX in taskflow bounded to view history records in the table.

    DB table is simply with a single primary key and number of columns.

    On the page, I show only little of them (Date, user, Rec.Number and State).

    When I open this dialog box with records that hold these documents

    ID Date user RecNumber State

    67

    02.01.07User111

    68

    02.01.07User122

    69

    02.01.07User131

    70

    02.01.07User142

    71

    02.01.07User151
    7202.01.07User162

    I see highlighted records with status = 1. Click on any record highlighting disappears and when I try to move the cursor down through the cursor of the keyboard (arrow keys) Stoops (pressing "down") until that record 3rd then skip (press 'down' key) 2nd record and repeat this. When I try to move the top slider to 5th/4th then folder and back loop.

    When I leave the body of the table and click outside the table then highlighting appears again.

    If I show only records State = 1 then all records are highlighted and the cursor jumps between 2nd and 5th record.

    ADF table is created simply by dragging and dropping of DataControl with RowSelection simple =, rowBandingInterval = 0, filterVisible = "true".

    I can find no reason for this kind of behavior.

    Please help me understand what can be the reason of this madness.

    Thanks in advance

    I check the original Version and compare it with the last good version.

    I found at the end

    This section is missing from the right version

    I add

    and everything is fine now.

    The same problem was in an another PK VO. missing base table.

Maybe you are looking for