Applescript ScriptUI or Flex (hesitations)

Hi Guys,
I wrote applescript scripts that my customer is happy with. We chose applescript as the script was aimed to work with QuarkXpress and Indesign on mac platforms.
But as native applescript is quite limited in the interface area, they want to turn into Javascript extended abilities regarding to Interface Creation. I am ok with that. The only concern I have is that the Applescript codes were executing system operations such as zipping/unzipping, http connections (curl in a do shell script), remove files...
I know you can execute applescript with javascript and doScript (in a mac environment of course) and I have to run some tests. However, as I want to dig with Flex as much as possible from now, I thought I could use it instead of ScriptUI.
BUT whatever I use ScriptUI or Flex, I have no certitudes that they will do what I need them to do like I explained above. Do you have any feedback on this topic ? Is one of these technologies more appropriate ? Maybe none of these can do the trick ?
Any advice would be welcome.
Loic

Hi and thanks a lot Shane and Harbs for your helpful answers,
Ok, I have now great material and indications to dig further.
One last thing Harbs, I was told Applescript studio project couldn't be ran from Indesign.
http://macscripter.net/viewtopic.php?id=34296
Because the main problem is that teh customer wants some widgets that standard Applescript can't offer (Dropdowns, checkbox...). So Applescript Studio looked like the solution but it seemed like it could be only used as an external software.
Loic

Similar Messages

  • ScriptUI and Flex SDK version

    Hello,
    what is the last Flex SDK version supported by ScriptUI?
    It seems I'm having troubles loading a swf made with Flex 4.5 (Flash project, not AIR).
    I've been told that 3.6 is the latest, usable SDK - yet I'm afraid it could be a permission issue (the error says: "Error #2032: Stream Error. URL: /Volumes/Macintosh HD/DEVELOPER/myExtension/GUI_Test/resources/framework_4.5.0.20967.swf")
    Thanks in advance
    Davide

    I confirm that with Flex SDK 3.6 the problem disappears - following versions are not supported (alas). You can download it here.
    Davide

  • Linking a JS object to ScriptUI listbox item

    I am writing a script that that takes elements from a document and for each element makes a custom object with its own properties and methods. This list of elements is then spat out into a ScriptsUI listbox.
    How do I link each listbox item to its associated obejct? i.e. So if I double click on a listbox item it will run a particular method within that object.
    P.S. I dont want to have to store array ids in a column or something hacky like that.

    Yep, it seems that the Translator component of the MVVM pattern wouldn't be very useful in a ScriptUI perspective.
    The most asbtract pattern you have to deal with, I think, is the GenericList widget (ListBox, DropDownList, maybe TreeView?) and its relationship with what we may call a DataProvider (following Flex and .NET terminology). But ScriptUI/ExtendScript does not allow a serious level of data binding.
    The whole problem is to emulate something of a dynamic link so that the data provider can notify the List widget of some changing. As a response, the List then would update its items accordingly. A skeleton of this approach could be drawn using custom event notification:
    const EXTERNAL_EVENT_TYPE = 'myEventType';
    var externalProcess = function F()
        if( F.targetWidget )
            F.targetWidget.dispatchEvent(new UIEvent(EXTERNAL_EVENT_TYPE));
    // =====================================
    // UI
    // =====================================
    var w = new Window('dialog', "Example"),
        // register the LB as a target:
        lb = externalProcess.targetWidget = w.add('listbox'),
        b = w.add('button',undefined,"Test Change");
    lb.addEventListener(
        EXTERNAL_EVENT_TYPE,
        function(){ alert("Something is happening. I need to update my items!"); }
    b.onClick = externalProcess;
    w.show();
    but I'm afraid this code—which, by the way, works!—leads us to an anti-pattern! Indeed, while we have to register and maintain a reference to the List widget in the external object (which is assumed to wrap the data), we still need to tell the list how to access the data provider in order to update the list items. The only benefit of the scheme above is that the external process can notify the list at any moment. Maybe this could make some sense in a non-modal context (palette), but this doesn't solve the original problem.
    So, intuitively, I would tend to take the opposite view: instead of making the external process trigger some event in the UI when its data change, let simply provide a generic resync() method to the list widget. The paradigm, here, is that a data provider should always be an array structure whose elements expose a toString() or whatever feature. If the list widget has a reference to some data provider, then it can load and/or resync the list items using always the same abstract routines. Then we have something purely prototypal:
    ListBox.prototype.load = DropDownList.prototype.load = function(/*obj[]&*/dp)
    // =====================================
    // A simple load method based on the assumption that
    // all dp items offer a toString() ability
        // Manage a reference to the data provider
        this.properties||(this.properties={});
        this.properties.data||(this.properties.data=[]);
        dp?(this.properties.data=dp):(dp=this.properties.data);
        // Vars
        var CAN_SEP = 'dropdownlist'==this.type,
            n = (dp&&dp.length)||0,
            i, s;
        // Add the ListItem elems
        for (
            i=0 ;
            i < n ;
            s=(''+dp[i++]),
            this.add(CAN_SEP && '-'==s ? 'separator' : 'item', s)
            // One could improve the code to support additional
            // keys for: multicol, images, checks, etc.
        return this;
    ListBox.prototype.resync = DropDownList.prototype.resync = function(/*obj[]&*/dp)
    // =====================================
    // Resync, or even reload, the data provider items
        this.selection = null;
        this.removeAll();
        return this.load(dp||null);
    ListItem.prototype.get = function()
    // =====================================
    // Return an object instance from the DP (behind this ListItem)
        return this.parent.properties.data[this.index] || null;
    From that point, what could the client code look like? We basically have two options:
    #1 The process is non-modal and then the external object will invoke List.resync(…) when required; in this case it MUST have a reference to the widget.
    #2 The process is modal, meaning that the 'external' object in fact is entirely interacted from the UI (e.g. via a button click); in that case no external reference to the list widget is actually required since the UI module itself knows exactly when a List.resync() is required, so why should it delegate the job? Here is a basic example in such a context:
    // Let's have some arbitrary 'OOP' stuff available
    var MyClass = function(uid,str)
    {   // constructor
        this.id=uid||0;
        this.rename(str||'');
        // various methods
    MyClass.prototype.rename = function(str){ this.name=str||'<unknown>'; };
        // toString()
    MyClass.prototype.toString = function(str){ return this.name; };
    var myDataProvider = [
        // some array of instances
        new MyClass(3, "Name 3"),
        new MyClass(5, "Name 5"),
        new MyClass(7),
        new MyClass(11, "Name 11, OK?")
    var processChanges = function()
    {   // emulate various changes in the data provider
        myDataProvider[0].rename("New name (3)");
        myDataProvider[2].rename("Finally Born 7");
        myDataProvider[myDataProvider.length] = new MyClass(13, "Did you miss 13?");
        myDataProvider[myDataProvider.length] = new MyClass(17, "Hello 17");
        myDataProvider.splice(1,1);
    // Now the User Interface:
    var w = new Window('dialog', "Example"),
        lb = w.add('listbox').load(myDataProvider),
        b = w.add('button', undefined, "Test Changes!");
    lb.onDoubleClick = function()
        var someInstance = this.selection.get();
        alert( "My secret UID is: " + someInstance.id );
    b.onClick = function()
        processChanges();
        lb.resync();
    w.show();
    Does it make sense?
    @+
    Marc

  • Indesign Script Opening Flex App / Tab Handling

    Hi,
    I am working on a  FlashBuilder 4 application that is opened from, and interacts with, an  Indesign CS4 .jsx script. I have added a TitleWindow that  provides for login processing (there is a backend database) to the Flex application. The login  window is opened from the method that is registered as the  initialization method for the Flex application. The flow works nicely.  The application, with its presentation of a TabNavigator holding the  core panels, visually appears then the login TitleWindow opens modally.  The id / password is entered, then the web service is called that  handles verifying login. The event handlers that receive the callback  from this then populate the controls on the application if the user is  verified.
    The problem I am having is with tabbing on the  TitleWindow. No matter what I do (tabEnabled / tabIndex settings, etc.) within Flex,  the TitleWindow will not receive tab presses and react to them. Tabbing  seems to cycle through the Indesign application in the background.
    From a  ScriptUI perspective the Flex application is opened as a Window (I've  tried Palette with similar results. I need it to be non-modal). Not only does the first tabbable  field not get focus, even when explicitly coded to do so, if you try to  tab off of it, which doesn't work, then click on the  second field on the TitleWindow to force focus, the first keystroke you type into the text field is ignored.
    If  I test the application from FlashBuilder directly, without being invoked  as a ScriptUI Window / FlashPlayer, the first field gets focus, tabbing  works, etc.
    Can anyone tell me how to make the login window behave such that I can set focus on field 1 and have it respond to tab  presses to cycle to the second field? Is there something I should do in the FlashBuilder application's invocation within the .jsx?
    Here are the operative lines from the script:
    var res =
    "window {        \
        fp: FlashPlayer { preferredSize: [1100,650], minimumSize:[800,450], maximumSize:[1200, 850] },    \
    var importFlashWindow = new Window (res,"Import Stories", undefined, {resizeable:true, independent:true});
    importFlashWindow.onShow = function(){
        var movieToPlay = new File (mySWFFile);
        try {
            //This function must be declared before the swf file is loaded as the flex panel calls it
            //from its init method.
            this.fp.getBaseUrl = getBaseUrl;
            this.fp.loadMovie(mySWFFile);
            //etc.
    I have posted the same basic question in the Flex / FlashBuilder forum with no response. I'm hoping someone here might know what I need to do to get the FlashBuilder application to receive the tab presses instead of the Indesign application behind it.
    Any help appreciated.
    Thanks,
    David

    Hi All
    I'm doing somthing similar.
    I have many textArea in my SWF file and I can't copy and paste text in it using shortcuts.
    If I paste contents using the Indesign menu commend, all works fine.
    Someone can help me?
    thanks
    Ivan

  • License migration from Flex Builder 3 to Flex Builder 4

    I am ready to purchase a license for Flex Builder but am hesitant to do so.  It appears that Flex Builder 3 is available now with Flex Builder 4 coming within some time period.  If I buy a Flex Builder 3 license now will I be entitled to Flex Builder 4?   If not, should I wait for FB 4 to become available?  What is the anticipated ship date of that product?
    Neil

    From our FAQ
    Q: If I purchase Flex Builder 3, am I eligible for an upgrade to Flash Builder 4?
    A: Adobe has not yet announced the ship date of Flash Builder 4. To be eligible for a free of charge upgrade to Flash Builder 4, you will need to purchase maintenance along with your purchase of Flex Builder. You can purchase maintenance with your Flex Builder 3 Standard purchase for an additional $99 US which makes you eligible for a free-of-charge copy of Flash Builder 4 Standard edition when it ships. You can purchase maintenance with your Flex Builder 3 Pro purchase for an additional $299 US. To purchase maintenance, you will need to buy through an Adobe reseller. In the US, please contact CDW at 800-800-4239.

  • Use javascript to make a Flex panel?

    Trying to make a functional indeterminate progress bar, i'we tried almost anything i could think of. nothing worked (or it worked badly). the one thing i haven't tried yet is to use actionscript to create a palette with a swf movie inside.
    but i need to create and call this palette using javascript.
    is there a way to do this? something like:
    app.doScript("actionscript code bla bla bla",ScriptLanguage.ActionScript)

    You can't run a Flex script with doScript, you need to "run" it as an SWF inside a ScriptUI component:
    http://blogs.adobe.com/indesignsdk/2009/05/flash_uis_with_indesign_cs4.html

  • Combining a Flex FileInfo panel for Illustrator with an Illustrator Javascript

    I've got an Illustrator script (Javascript) that writes XMP based on the content of the artwork, but the script has to be manually triggered. I've got a custom FileInfo panel (built with Flex/AS3) to help me edit the XMP once stored.
    I'd like to combine the two, so the Script fires whenever the FileInfo panel opens.
    I can't do the DOM scripting directly in AS3, can I? I think that Illustrator is only open to Javascript, VB, and AppleScript. Please correct me if I'm wrong.
    Does anyone have any ideas how to call the javascript in the Scripts folder from an event in the FileInfo panel's SWF, and pass arguements back and forth? I've seen it done on webpages, but only when both the SWF  and javascript are on the same HTML page.
    Thanks

    Hi Hui
    Well, sort of, although I've made a bit more progress now and the events part seems to be working.
    I originally thought that fPPLib was specifically for Flex/Flash but I now realise that it is the main PlugPlug interface (which now includes HTML5 panels - right?)
    I think what I really need is HTML5 panels 101 (for Illustrator). The exmples in this forum are InDesign specific and all the c++ libraries are different. Also nothing I've seen so far shows how to make an extension work from within Illustrator's menus (as opposed to just from Window->Extensions).
    I have a plugin which requires input parameters from the user.
    What I am trying to do is.
    1) Create an HTML5 extension panel which will collect values from the user.
    2) Attach that panel (or is it a modal dialog) to say Object->Filters in the main Illustrator menu
    3) Have that panel load previous plugin parameters (*from the current session)
    4) Validate the user values in the panel.
    5) Make the panel communicate those values to the plugin
    6) Show/Hide the panel as required (i.e. open it from a menu item, close it when done).
    Also, in the original flash panel which I am trying to adapt, there is a lot of ActionScript in the mxml file.
    Where does all that go now? Is that what ExtendScript is for (and if so are there some useful tutorials on it anywhere?)
    I know that is a lot of questions. Apologies - I'm new to this and impatient to make some real progress.
    Cheers,
    Rob

  • RapidScriptUI - ScriptUI Generator - free until 3/29/09

    We are proud to announce to our fellow scripters that our breakthrough product RapidScriptUI is now available for download at http://www.scriptui.com.
    We are convinced that our product will make it considerably easier to create ScriptUI code without having to write the error prone code.
    This is how it works, you download the Windows (.net 2.0) application at our website. Design, test your dialog using Photoshop, Indesign or Illustrator and save .rapid file. Then go to website http://www.scriptui.com/upload.aspx and upload your file and email address. click try it free and we will instantly forward to you an email with the JavaScript code.
    After the free trial time, there will be 2 purchase options as detailed on Website, with our basic option starting at just $2.
    For pictures of app and sample dialog created (immitation of new Character Style dialog in InDesign) see http://www.scriptui.com/gallery.aspx.
    Thanks

    The scripts produced are cross platform. it's the app that isn't see Indesign scripting Forum and http://www.scriptui.com/faq.aspx
    Thanks to all that tried out Rapid ScriptUI and http://www.scriptui.com.
    At this point we are testing the payment system on scriptui.com and all purchases made before April 6, 2009 will be refunded as is written on http://www.scriptui.com/upload.aspx under payment button.
    As it concerns mac users. it would be possible using the mono project to use app on the mac, however the ability to preview won't work since it uses com technology which doesn't exist on mac. However it might be possible to dynamicly create applescript which will do the same thing (create javascript and run in Photoshop etc..). However it is important that the code should not be exposed through command line etc..
    Anyone with knowledge to share with or without some reimbursement could share it here or email at 'support [at] scriptui .com'.
    Thanks again

  • Applescript support for future CS

    Hi,
    I was asked by a customer if Applescript is going to be still supported in the next CS versions (starting from CS5).
    As Adobe is focusing more and more on Flex/AS3 for extensions, the question has made sense to me. So I ask here.
    Do you have any infos on that topic ? Will Applescript be supported for ever, is it planned to be abandoned ?
    Loic

    I would love to see Applescript support within Bridge, as I need to integrate Bridge, Filemaker, BBEdit, and OmniPlan into a start to finish workflow system. Javascript just doesn't cut it as it relates to file handling/manipulation.
    Kurt Jones
    [email protected]

  • Scripting functionality  in flex

    hi,
    can we expose our flex methods to Photoshop, Illustrator scripting DOM,So that Photoshop scripts written in applescript, javascript, and vbscript can include references to our methods and objects.
    any suggestion is really helpful for me..

    You can call Flex functions from JS using ExternalInterface:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/External Interface.html

  • Help! Scriptui close method blocks interraction:

    I am not new to Scripting Indesign but have opted to use the normal dialog options till now and am a little confused by several of the scriptui methods.
    I first attempted to search this forum but the few examples I found were rather vague so I appeal to you now.
    It seems that when I call the close() method on a scriptui dialogs ok or cancel event, it merely hides the object.
    The hidden object (dialog) prevents execution of any script; (ie: app.documents.add();)
    and returns the following error:
         Error: Cannot handle the request because a modal dialog or alert is active.
    Can anyone provide a clear and precise example of closing a script ui dialog then creating a simple document without interference?
    This may benefit others besides me who are finally making the move into the scriptui universe.
    Oh to have CS5 and Flex throughout my company instead of CS4 and scriptui !

    I was able to find a good example for this question from an old script by Dave Saunders:
    http://jsid.blogspot.com/2007/08/scriptui-dialog-with-interacting.html
    //DESCRIPTION: Sample Dialog
    myDlg = new Window('dialog', 'Example');
    myDlg.orientation = 'row';
    // Add action buttons
    myDlg.btn1 = myDlg.add('button', undefined, 'Disable Him');
    myDlg.btn2 = myDlg.add('button', undefined, 'Disable Him');
    myDlg.closeBtn = myDlg.add('button', undefined, 'Close');
    // Add button functions
    myDlg.btn1.onClick = function() {
      if (this.text == 'Disable Him') {
        this.text = 'Enable Him';
        myDlg.btn2.enabled = false;
      } else {
        this.text = 'Disable Him';
        myDlg.btn2.enabled = true;
    myDlg.btn2.onClick = function() {
      if (this.text == 'Disable Him') {
        this.text = 'Enable Him';
        myDlg.btn1.enabled = false;
      } else {
        this.text = 'Disable Him';
        myDlg.btn1.enabled = true;
    myDlg.closeBtn.onClick = function() {
      this.parent.close(1);
    result = myDlg.show();
    if (result == 1) {
      alert("You used the Close button");
      app.documents.add();

  • Forums dedicated to scriptUI & special offer on Rapid ScriptUI

    All the time I was working on Rapid ScriptUI I wished there was a central location where I could turn to, a forum dedicated to it's properties, syntax and tricks. So I created my own forums for that purpose at http://forums.scriptui.com and I hope it will help all of us. So please sign up and support the cause,  we guarantee not to spam you.
    In order to make some excitement I am offering my Rapid ScriptUI application for a fraction of its regular price at $20. This is only available at a special link http://scriptui.com/specialoffer.aspx. This is for a limited time only. Feel free to ask any questions as http://scriptui.com/contact.aspx.
    Thanks
    Steven
    http://scriptui.com

    Your tool does sound interesting and I wish you the best. But personally I'm at a point now where I can either crank ExtendScriptUI out fast enough to suit my needs, or I'm going to have to start using Flex for more sophisticated Adobe script user interfaces.
    There is a niche for your software and I hope you're able to find it. Helping out people piecemeal with xtools or custom bits of code is not exactly the best solution for new comers.

  • Applescript. Making dependant buttons in dialog windows

    Hello, I am learning on making dialogs with Adobe InDesign CS3.
    Is it possible to "grey out" some parts of the dialog window, depending on a certain selection of a radio button? I mean: I have a radio button group and depending on which radio button is selected, I want to grey out some other options in the very same dialog window that are not relevant anymore (for example some check boxes).
    And if possible can anyone provide me with an example code?
    And if impossible can it probably be done with Applescript Studio? I don't know.
    Kind regards,
    Bertus Bolknak

    Hi Bertus,
    In JavaScript – in ScriptUI, not in InDesign’s dialogs – you can set enable property of control objects to false.
    As to Applescript Studio, I think, It’s possible too, but I’m not sure – attributes pane in the Info window has ‘Enabled’ checkbox. I did an interface with radio buttons group (BTW in Applescript Studio it’s called matrix) long ago, but it was quite a hassle. I was doing it by trial-and-error method as couldn’t find an intelligible reference. But the interface came out more attractive, and what was more important to me, Cyrillic characters were fully supported, as opposed to InDesign’s dialogs.
    Kasyan

  • UI Element Inspector for identifying Adobe Flex Installers on Mac

    Hi All, can anyone tell me, which tool to identify UI elements of flex based Installers on Mac. am not able to write applescript without finding those elements, since Xcode's accessibility Inspector not recognizing the same. I dont want to go with Sikuli tooo..

    Hi Thomas !
    The problem is that the event isn't getting triggered. The wrong abap code in the methode.
    The syntax of the Methode ONACTIONONCLICKGANTTCHART is not incorrect, but does not make the correct things.
    I read the instructions here:
    [http://help.sap.com/saphelp_tm70/helpdata/de/57/174c7589334b45b3c4b2bce7a4dce1/content.htm|http://help.sap.com/saphelp_tm70/helpdata/de/57/174c7589334b45b3c4b2bce7a4dce1/content.htm]

  • Applescript library app.

    Let me preface this by stating that I am a total Flex
    neophyte. I've been brainstorming Flex app. ideas. I am wondering
    if it would be possible to create an Air app.-- Applescript
    library. With which one could run Applescripts out if it. And link
    it to a server so that if an Applescript is ever updated, it would
    also update the script with the library on your desktop app. Is
    this possible? Where would I begin? Any information is appreciated.
    thanks,
    nate

    I don't really understand the question, but note that there hasn't been an AppleScript folder in the Application folder since 10.5. You will now find the former Script Editor app in the /Applications/Utilities/ folder, and it's now called AppleScript Editor. As to the rest of what was in there, see:
    http://www.macworld.com/article/142495/2009/08/snowleopardwhatsgonewhere.html

Maybe you are looking for

  • Can't print from Photoshop or Lightroom

    OS: Mac, Intel, OS X 10.6.7 (Snow Lepoard) Photoshop CS5, v12.0.4, x64 Lightroom 2: v2.7 Printers: Epson colour inkjets, HP LaserWriter, Brother colour inkjet Hello All. I am at a lost with this issue which has only started in the last month or so on

  • How to re-install Win XP on Portege 3500?

    Hi! I've got a problem with our Portege P3500 (PP350E): The Windows XP Tablet PC Edition on it is currently still running, but due to a lot of installed and improperly de-installed software, it's very slow, so I'd like to re-install the OS "from scra

  • I'm trying to sync my ipad to the itunes library - but I get an error message saying I Tunes Library full.  What can I do?

    I have an Ipad 2. I am trying to sync my ipad to the itunes library, but I get an error message - saying the itunes library is full.  How can that be? I've deleted lots from the library to see if that would help - but it still states I am about 25gb

  • Orphaned DB session on remove() of CMP EJB?

    During a stress test of our application we encountered a strange situation after several days. An ApplicationServerThread was locked on a socketRead of the Oracle thin driver connected to Oracle 8.1.7 on Solaris. Checking the database locks we found

  • Class not found with jms cache sync

    hi. when i try to use the remote command manager in my live environment only i get a class not found exception for my initial context factory. using a debugger i discovered this is actually hiding a linkage error. so i confirmed that my resin and jav