• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
AppleScript to JavaScript and back
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AppleScript to JavaScript and back


  • Subject: AppleScript to JavaScript and back
  • From: Oakley Masten <email@hidden>
  • Date: Fri, 1 Aug 2008 08:54:21 -0700 (PDT)

Ok I feel pretty dumb here so Help!

Trying to use _javascript_ listener to do things with PhotoShop CS2.
We want to do several things that _javascript_ might help.

I recorded a _javascript_ and ask a friend who knows _javascript_ to help.

We can't figure out how to pass the path and file name to save the image in
from AppleScript to _javascript_.

Where do I start?

Does the path have to be POSIX or can I use HFS?
If POSIX do I format it with applescript and then pass
and if so what is the exact format?

Any help would be greatly appreciated

Thanks
Oakley

Here is what we recorded:
// =======================================================
var id1 = charIDToTypeID( "Opn " );
    var desc1 = new ActionDescriptor();
    var id2 = charIDToTypeID( "null" );
    desc1.putPath( id2, new File( "/WEB_Images_PreCropE775/Large_Cropped_4WEB/Collect_Web_Pix_Done/0088317_775_08_mstr.jpg" ) );
executeAction( id1, desc1, DialogModes.NO );

// =======================================================
var id3 = charIDToTypeID( "Expr" );
    var desc2 = new ActionDescriptor();
    var id4 = charIDToTypeID( "Usng" );
        var desc3 = new ActionDescriptor();
        var id5 = charIDToTypeID( "Op  " );
        var id6 = charIDToTypeID( "SWOp" );
        var id7 = charIDToTypeID( "OpSa" );
        desc3.putEnumerated( id5, id6, id7 );
        var id8 = charIDToTypeID( "Fmt " );
        var id9 = charIDToTypeID( "IRFm" );
        var id10 = charIDToTypeID( "JPEG" );
        desc3.putEnumerated( id8, id9, id10 );
        var id11 = charIDToTypeID( "Intr" );
        desc3.putBoolean( id11, false );
        var id12 = charIDToTypeID( "Qlty" );
        desc3.putInteger( id12, 60 );
        var id13 = charIDToTypeID( "QChS" );
        desc3.putInteger( id13, 0 );
        var id14 = charIDToTypeID( "QCUI" );
        desc3.putInteger( id14, 0 );
        var id15 = charIDToTypeID( "QChT" );
        desc3.putBoolean( id15, false );
        var id16 = charIDToTypeID( "QChV" );
        desc3.putBoolean( id16, false );
        var id17 = charIDToTypeID( "Optm" );
        desc3.putBoolean( id17, true );
        var id18 = charIDToTypeID( "Pass" );
        desc3.putInteger( id18, 1 );
        var id19 = charIDToTypeID( "blur" );
        desc3.putDouble( id19, 0.000000 );
        var id20 = charIDToTypeID( "EICC" );
        desc3.putBoolean( id20, false );
        var id21 = charIDToTypeID( "Mtt " );
        desc3.putBoolean( id21, false );
        var id22 = charIDToTypeID( "MttR" );
        desc3.putInteger( id22, 255 );
        var id23 = charIDToTypeID( "MttG" );
        desc3.putInteger( id23, 255 );
        var id24 = charIDToTypeID( "MttB" );
        desc3.putInteger( id24, 255 );
        var id25 = charIDToTypeID( "SHTM" );
        desc3.putBoolean( id25, false );
        var id26 = charIDToTypeID( "SImg" );
        desc3.putBoolean( id26, true );
        var id27 = charIDToTypeID( "SSSO" );
        desc3.putBoolean( id27, false );
        var id28 = charIDToTypeID( "SSLt" );
            var list1 = new ActionList();
        desc3.putList( id28, list1 );
        var id29 = charIDToTypeID( "DIDr" );
        desc3.putBoolean( id29, true );
        var id30 = charIDToTypeID( "In  " );
        desc3.putPath( id30, new File( "/Users/omasten/Desktop" ) );
    var id31 = stringIDToTypeID( "SaveForWeb" );
    desc2.putObject( id4, id31, desc3 );
executeAction( id3, desc2, DialogModes.NO );

// =======================================================
var id32 = charIDToTypeID( "Cls " );
    var desc4 = new ActionDescriptor();
    var id33 = charIDToTypeID( "Svng" );
    var id34 = charIDToTypeID( "YsN " );
    var id35 = charIDToTypeID( "N   " );
    desc4.putEnumerated( id33, id34, id35 );
executeAction( id32, desc4, DialogModes.NO );
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: AppleScript to JavaScript and back
      • From: Stan Cleveland <email@hidden>
  • Prev by Date: Re: Alias Files
  • Next by Date: Re: Alias Files
  • Previous by thread: Quark Convert Pounds Sterling to Euros
  • Next by thread: Re: AppleScript to JavaScript and back
  • Index(es):
    • Date
    • Thread