Java Script to perform a different Action based on the Orientation of the Image

I need help creating a Java Script to perform a different action based on image orientation landscape vs. portrait. Can someone help me in this task.

Thank you

The Wookiee

That should do it.

docRef = app.activeDocument;

If (docRef.width > docRef.height) doAction ("Action of landscape", "action group '");

another action ('Portrait Action', 'Action Group');

Tags: Photoshop

Similar Questions

  • Need help with Java Script to perform a calculation in the form of Adobe Acrobat Pro 9

    I have a form (test) I created in Adobe Acrobat 9 Pro.

    I need help to create a custom JavaScript, so I can get the desired response.

    1) there are several questions in each group requiring a numeric response between 0-4

    2) there is a total set up field to calculate the sum of the responses of all of the above questions

    (3) the final "score" takes the answer in step 2 above and divide by the total possible response

    Any help to what Java Script I need to fill it would be greatly appreciated!

    I have attached a spreadsheet "" which shows more in detail as are the result of what I used in Excel to get the desired end formulas.

    Thanks in advance.

    Have you tried the "field is the average of:"?

  • Creating conditional actions based on the results of the quiz

    I have a quiz at the end of my captivate file and I try to get to show different based on images if you have passed the quiz, or if you failed. For example if you pass, I want to show an image of the tick, and if you do not have an image of the cross, on the results slide.

    I tried to create this by implementing a conditional action. I put the two images on the slide and they hid. Then I have a conditional action value:

    IF
    cpQuizInfoPointsscored greater than or equal to 70

    ACTION

    See the Image_tick

    ON THE OTHER

    See the Image_cross

    When I play the quiz or image shows that I have success or failure (the quiz is set to a 70% pass - there are 10 questions, and all are worth 10 points)
    I am new to Captivate so that any help would be appreciated!
    Thank you

    Each action must be triggered by 'something', which is an event. You must attach to an event, I suspect that the event on enter score slide is one that suits. Select the slide of score, look in the properties panel, tab Actions, perform actions on enter, choose the action.

    In addition, there is a difference between the system variable cpQuizInfoPointsscored and cpInfoPercentage. Personally, I would use the simpler cpQuizInfoPassFail:

    IF cpQuizInfoPassFail is equal to 1

    See the tick

    On the other

    See the cross

    Download the tables in these two articles:

    System variables in Captivate 8/9 - Captivate blog

    Events / Actions (Advanced) - Captivate blog

  • Script to add keywords in Bridge based on the name of the file

    I'm working on a script that adds keywords based on the name of the image file. So, if the name of the file is AG123456 (08_16) .tif, this script would add "Agriculture", "123456" and "8/16" as keywords in bridge. "" I have a small sample of the part that retrieves the name of the file written in AppleScript below of each keyword. I know that I need to write the part that actually adds the keywords in Bridge in JavaScript, because the bridge is not capable of AppleScript. I have trouble finding the JavaScript code, I need to add the keyword. If someone could help me with this, I would really appreciate it.

    I would like to call the JavaScript code to in AppleScript instead of writing all the code in JavaScript. (The full version of it's longer, it would be a lot of code to change in JavaScript).

    on Open of droppedfiles

    with timeout of 900 seconds -> Changing timeout to 15 minutes. Default value is 2 minutes.

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

    -GET THE CHARACTERS OF THE FILE name

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

    Repeat with aFile in droppedfiles

    say application 'Finder '.

    the value file name to name of aFile

    end say

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

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

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

    -ADDED a KEYWORD FOR EACH PREFIX

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

    -Find the prefix in the name of the file

    if text 1 thru 2 of file name contains "AG" then

    the value prefixKeyword to 'Agriculture '.

    else if text 1 thru 2 of file name contains "To THE" then

    the value prefixKeyword to "Automobile".

    on the other

    the value prefixKeyword to "Need to prefix".

    end if

    -Adding the prefix as a keyword

    display dialog prefixKeyword string

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

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

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

    -ADDED a KEYWORD FOR EACH SKU NUMBER

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

    -Creating a list of all single digit numbers

    the value numberList to {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}

    -Looking FOR THE SKU NUMBER

    -Looking for a six-digit number that starts on the third character of the file name

    if numberList contains (text 3 of file name) et numberList contains (text 4 of the file name) et numberList contains (text 5 of filename) et numberList contains (text 6 of file name) et numberList contains (text 7 of file name) then

    if numberList does not work contain the text 9 of file name and then

    if numberList contains (text 8 of the file name) then

    the value skuNumber to of 3 to 8 text filename

    the value skuNumberOffset to 8

    end if

    end if

    -Searching for a six-digit number that begins on the fourth character of the file name

    else if numberList contains (text 4 of the file name) et numberList contains (text 5 of filename) et numberList contains (text 6 of file name) et numberList contains (text 7 of file name) et numberList contains (text 8 of the file name) then

    if numberList does not work contain the 10 text of file name and then

    if numberList contains (text 9 of file name) then

    the value skuNumber to text 4 to 9 of file name

    the value skuNumberOffset to 9

    end if

    end if

    -Defining the SKU number to alert keyword keyword the user can search the

    on the other

    the value skuNumber to "Need SKU number.

    set skuNumberOffset to 0

    end if

    -ADDING THE SKU AS NUMBER one keyword

    display dialog skuNumber string

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

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

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

    -DATE ADDITION OF FILE name

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

    if file name contains "(" et nom de fichier contient ")" then "

    set leftParen to "("

    set rightParen to ")"

    -Obtain the month of the file name

    set monthOffset of (offset of leftParen in fileName) + 1 -> character returns immediately after)

    set fileNameMonth to character of filename monthOffset

    -Get all the numbers of the year of the file name

    set fileNameYearOffset1 to (offset of leftParen in file name) + 3

    set fileNameYearOffset2 to (offset of rightParen in file name)-1

    set fileNameYear1 to character of filename fileNameYearOffset1

    set fileNameYear2 to character of filename fileNameYearOffset2

    set of characters fileNameYear fileNameYearOffset1 to fileNameYearOffset2 of file name

    set dateKeyword to fileNameMonth & "/" & fileNameYear

    -ADDING THE SKU AS NUMBER one keyword

    display dialog dateKeyword string

    end if

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

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

    fin Repeat

    end timeout

    end open

    Here's an example of adding of keywords in a file, the code can be used in Bridge or Photoshop.

    var Keys = ["keyword1","keyword2","keyword3"];
    var file = File (Folder.desktop + "/zz.jpg");
    if(file.exists) setKeyword( file,Keys);
    
    function setKeyword( file,Keys){
    if ( !ExternalObject.AdobeXMPScript ) ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
            var xmpf = new XMPFile( File(file).fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE );
            var xmp = xmpf.getXMP();
            for(var s in Keys){
            xmp.appendArrayItem(XMPConst.NS_DC, "subject", Keys[s], 0,XMPConst.PROP_IS_ARRAY);
        }
          if (xmpf.canPutXMP( xmp )) {
             xmpf.putXMP( xmp );
          }
          xmpf.closeFile( XMPConst.CLOSE_UPDATE_SAFELY );
    };
    
  • Apex 5 schedule: different color based on the value of data field

    Dear Experts,

    I need to have a different color for each record on the calendar based on the value of the data field (eg. category).

    How can I achieve this?

    Thank you!

    See: -.

    You don't have to wait for APEX 5 integration FullCalendar ~ Blog of Doug Gault...

  • Redirect to different pages based on the value of linked report table

    Hello

    I wanted to navigate to different pages of a report link based on a value from the table on which the report is based. I was able to link to a particular page without any problem.

    But I wanted to link to different pages depending on the value in the table. Please let me how can know I do this?

    Thank you

    Kaminey wrote:
    I use Apex 4.2 and my report is a classic.

    If I click on empID in a classic report, now it redirects to page 1. Now what I want to do, if I click empID, if his role as MANAGER he should redirect to page 2 and fill out the form on the page with the details of the employee. The role of the employee is ANALYST should redirect to page 3 and fill in the form on the page with its details

    This approach makes maximum use of the APEX has standard and minimizes the extra programming.

    1. If it is not already included as a displayed value, include the role column giving the value of MANAGER/ANALYST as a hidden column in the report.

    2. create the link in the column on the EmpID column, with the target of the link on the same page as the report and ask the role column value (for example #ROLE #).

    3. on the page of the report, create a On Load: front branch to page 2, with an request = Expression 1 condition with 1 Expression defined for the MANAGER.

    4. on the report page, create a On Load: front branch to page 3, with a Request = Expression 1 Expression 1 ANALYSTvalue condition.

  • Forms - submitting to different recipients based on the selection

    I have a form I need to present it to different addresses depending on the option chosen in one of the drop down lists. This MUST be done on a form on the client side.

    Any ideas on how to go about it?

    I don't want to create a different form for each scenario.

    Thank you

    You can set the action attribute of form with js as well. as murray said, this isn't the way favorite of doing things, but if it is your only way you can control the browser uses your username does work.



    Form




  • Dynamic action based on the value in a table

    Greetings,

    I would like to use a dynamic action to disable a button depending on the value selected/entry in a field in tabular form. Thus, for example, if someone enters the value "LKSG", then a button is disabled (in this case, the 'Add Row' button).

    How I would do this using the tools of dynamic measurements? When I create a dynamic action, I see that my choice of Type 'selection' for dynamic action of shooting is point, area, button, object DOM, jQuery Selector. I don't know how to use a field in a presentation of tabular to firing. Or if it is possible.

    I use APEX version 4.1.1.00.23

    Thanks in advance!

    John

    jfosteroracle wrote:
    Tom - it's very useful! A few questions:

    -J' use a 'button of the model '. To use the static code for the button, I see that the model must include the #BUTTON_ID # in the model. I added the #BUTTON_ID # in the template like this:

    #LABEL#

    Where is the the BUTTON_ID should go, in the

    ?

    After adding this, it does not for a button of the model. But if I change the touch of a button HTML, your method works great!

    It is of course the difference between the two buttons: how they react and, above all, how they are marked upward. An HTML button is a real