Change cursor under script control

It would very helpful to be able to display a 'wait' cursor while an Illustrator script is running. I have several scripts which work on large numbers of objects, and I'm sure anyone running them would appreciate seeing the spinning colourwheel or hourglass while the script is looping away.
I understand that Adobe's Javascript Toolkit would let you build a progress-bar dialog, but the delays are rarely long enough to justify such a thing. All the same, a change of cursor would reassure users that things were indeed happening.
Scripting is an important feature for Illustrator, not just in saving effort, time and frustration, but because the work of the scripting community invariably suggests new features to be built into the core product or into plug-ins. Often scripts are seen and used by numbers of people other than their original authors. Anything that builds confidence in scripting's utility and capability is likely to be a good thing - and not just for Illustrator.

Thanks, Mark - helpful to know that you tried.
I think we can take the answer to my question as a 'no'. I'll post a suggestion in the Land of Forlorn Hopes, aka Illustrator Feature Requests.

Similar Messages

  • Is there a method in labviewto dynamically save and change the monitor resolution under program control?

    Is there a method in labview to dynamically save and change the monitor resolution under program control? I have another application that runs on another monitor. I would like to change the monitor resoultion to 640x480 on program startup, and then restore the monitor resolution back to the user's settings on exit. Can this be done?

    vaidehi_joshi wrote:
    Is there a method in labview to dynamically save and change the monitor resolution under program control? I have another application that runs on another monitor. I would like to change the monitor resoultion to 640x480 on program startup, and then restore the monitor resolution back to the user's settings on exit. Can this be done?
    Have you already done this manually?  I've seen Labview scale front panels very strangely when changing resolutions...
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Placing ~ under version control : ignore mask

    Hi.
    I am thinking of placing my home directory under version control.
    I understand there are threads in Arch and URLs on placing home under version control.
    But i find placing everything in ~ will be a waste of space since files such as
    web browser cache or icons changes constantly.
    I would like to know what does my fellow Archers ~ .ignore files contains?
    Any DVCS .ignore files are welcome.

    steveklabnik wrote:This seems to be a decent guide to how one guy uses SVN.
    Yes, it's a useful guide, but it doesn't discuss the "which files to ignore" part.
    I'm running my ~ in svn for already a while now, originally based on the ideas of the above article and some others.
    And let me tell you: there are many, many applications who are not consistent, dump cachefiles etc in folders in your ~, or also store things like "last opened, last window size, last status on msn (pidgin)" into your *config* files etc.   many applications seem to honor freedesktop's xdg specs on first sight, but in reality it's seldomly the way it should be.
    It's very hard to handle this, I have many ignore rules and I regulary do a `svn status ~` to update my ignore rules. I also have a script that svn reverts some known files.
    For me this list currently is:
    ~/.common/.mplayer/* \
            ~/.common/xdg/.config/vlc/* \
            ~/.common/.purple-private/logs/msn/*/.system/ \
            ~/.common/xdg/.config/banshee-1 \
            ~/.common/xdg/.config/totem \
            ~/.gconf/apps/banshee-1 \
            ~/.gconf/apps/brasero \
            ~/.gconf/apps/compiz/general/allscreens/options/%gconf.xml \
            ~/.gconf/apps/evolution \
            ~/.gconf/apps/file-roller \
            ~/.gconf/apps/gedit-2 \
            ~/.gconf/apps/miro \
            ~/.gconf/apps/panel/applets/applet_0/prefs/%gconf.xml \
            ~/.gconf/apps/panel/applets/clock_screen0/prefs/%gconf.xml \
            ~/.gconf/apps/nautilus/preferences/%gconf.xml \
            ~/.gconf/apps/rhythmbox \
            ~/.gconf/apps/totem \
            ~/.gconf/apps/update-manager/%gconf.xml \
            ~/.gconf/desktop/gnome/font_rendering/%gconf.xml \
            ~/.gconf/desktop/gnome/peripherals/keyboard/ \
            ~/.gnome2/evince/ev-metadata.xml \
            ~/.gnome2/gedit-2 \
            ~/.gnome2/rhythmbox
    When I used gnome this list was MUCH longer.  I am still in the process of getting rid of apps that misbehave badly (biggest offenders are gnome, gnome-do, tomboy, pidgin and for firefox and thunderbird I would even make a separate category: those directories are just filled with many (binary) files, impossible to manage.  I use separate rsync "repositories" for those)
    See http://dieter.plaetinck.be/Im_done_with_gnome_and_gconf
    Here are the outputs of:
    svn propget svn:ignore -R ~
    /home/dieter - .adobe*
    .aptitude
    .bashdb_hist
    .cache
    .cheat
    .dbus
    .deb-gview
    .civclientrc
    .dia
    .dmenu_cache
    .eclipse
    .evolution
    .fontconfig
    .freeciv
    .gem
    .gimp*
    .gcjwebplugin
    .gksu*
    .gnupg
    .gpilotd*
    .gstreamer*
    .gtkpod
    .gvfs*
    .hplip
    .icons
    .ies4linux
    .java
    .kde
    .macromedia*
    .mcop
    .metacity
    .mozilla
    .mozilla-thunderbird
    .nautilus
    .netxrc
    .openoffice.org*
    .pulse
    .qt
    .sane
    .scim
    .serverauth*
    .solfege
    .thumbnails
    .thunderbird
    .update-manager-core
    .update-notifier*
    .VirtualBox
    .w3m
    .wapi*
    .wine
    .xine
    bin
    eclipse-3.3*
    scripts
    .esd_auth
    .ICEauthority
    .mcoprc
    .pulse-cookie
    .recently-used*
    .sudo_as_admin_successful
    .tomboy.log
    .Xauthority
    .xsession-errors
    .scrobby.log
    scrobby.cache
    *.pid
    /home/dieter/.local/share/applications - *.desktop
    /home/dieter/.etwolf/jaymod - *.dat
    *.pk3
    *.so
    *.tmp
    /home/dieter/.q3a - qkey
    servercache.dat
    /home/dieter/.etwolf/noquarter/profiles/Dieter_be - servercache.dat
    /home/dieter/workspaces/eclipse - *
    /home/dieter/pictures-buffer - *
    /home/dieter/.etwolf/jaymod/profiles/Dieter_be - servercache.dat
    /home/dieter/.etwolf/etpro - *.pk3
    *.so
    *.tmp
    /home/dieter/audio-buffer - *
    /home/dieter/.local/share - bashrun
    vlc
    /home/dieter/.etwolf/etpro/profiles/Dieter_be - servercache.dat
    /home/dieter/workspaces/ardour - *
    /home/dieter/.gconf/apps - procman
    /home/dieter/.etwolf/pb - *.dat
    *.db
    *.so
    *.tmp
    /home/dieter/.miro - *
    /home/dieter/audio-selection - *
    /home/dieter/bin-blob - *
    /home/dieter/.exaile/saved - playlist0000.m3u
    /home/dieter/video-selection - *
    /home/dieter/.etwolf/pb/dll - *.so
    /home/dieter/.etwolf/etmain - etkey
    *.dat
    *.pk3
    *.so
    *.tmp
    You can build up a similar list like this:
    svn create a-place-for-your-home-in-svn
    svn checkout a-place-for-your-home-in-svn ~
    then do svn status ~, and you'll see lots of stuff. then go over everything and decide if you want it in svn or not. by adding it (non-recursively) or updating your ignore rules. that's how I am still building up my list.. all because of those damn programs who don't implement xdg cleanly
    Last edited by Dieter@be (2009-01-02 19:47:30)

  • How to change the size of control´s prompt?

    No matter the size of data to be displayed in the view suface prompt, the controls have the same size.
    Does anyone here know how to change the size of control in surface prompt?

    HI,
    In order to change the size of a radio button... one way you may consider is to Customise the Radio Button.
    Place a Radio Button (RB) on the FP of a VI, Right-Click the RB > Advanced > Customise...
    Click the Mode Button (most Left button) for Edit Mode
    Right-click the radio button (the round image) now, you will see a list of actions i.e. Copy to clipboard, import picture ...You will see Four images under the 'Picture Item', those are the images that you will need to replace.
    Prepare Four Images of the similar but larger expected size
    *** Copy the 1st new image to clipboard. Back to the Picture Item and select 1st image. Then, select Import Picture (to replace the existing image)
    Repeat *** for all four images.
    Once done, change the mode back to original. Save the *.ctl
    You are now ready to use the customised radio button!
    Quick sample attached (sorry for the poor images created )
    Ian F
    Since LabVIEW 5.1... 7.1.1... 2009, 2010
    依恩与LabVIEW
    LVVILIB.blogspot.com
    Attachments:
    IFK_RButton_Large.ctl ‏11 KB

  • How to change maintenance powershell script via GPO?

    Per suggestion reposted from here: http://social.technet.microsoft.com/Forums/windowsserver/en-US/6eece9d6-a524-48aa-8e64-7554f0ec9b31/how-to-change-maintenance-powershell-script-via-gpo?forum=winserverGP
    Posted at http://answers.microsoft.com/en-us/windows/forum/windows_7-desktop/desktop-shortcuts-to-items-on-network-drives/94eddb27-342b-40fc-9ad4-677ff4ee8ebe?page=9&tm=1403700614489 originally.
    There is a very annoying "feature" in Windows 7 called BrokenShortcuts.ps1 which is being called out weekly via maintenance task and if it finds more than 4 "broken" network shortcuts it removes them all. So it means if a user at this
    moment is disconnected from the network he will lose all links to shares, network applications sitting on his desktop. Funny that there was no such script on Vista and i don't see this on Win8. On the post i have attached one user suggested to edit this script
    and change 4 to 500 or whatever high number. That's fine for one time fix. But i need to do this for 200+ users. This file cannot be simply replaced by a script, so i'm wondering is there any way to do it via GPO?
    I have already tried various startup scripts, but i'm not sure which user to put into commands.
    I need to run this on startup:
    takeown /F C:\Windows\diagnostics\scheduled\Maintenance\TS_BrokenShortcuts.ps1
    icacls c:\windows\diagnostics\scheduled\maintenance\TS_BrokenShortcuts.ps1 /grant "some user":F
    copy \\share\folder$\TS_BrokenShortcuts.ps1 C:\Windows\diagnostics\scheduled\Maintenance\ /Y

    You need to take time to study how Windows does these things.  You can control them with GP which is what you asked.  The article shows you how to disable elements of the tasks.  Each task controls a script.  If you disable the task the
    script that deletes shortcuts will be stopped. Other maintenance tasks will continue to run.
    Most of your problem is that you seem to want someone to provide a magical solution.  In technology it is necessary to fully research your issues until you understand all aspects.  After fully studying the issue you should understand the possible
    solutions if they exist.
    You claim to have deployed the patch that Microsoft released to fix the issue.  You claim it didn't work.  If that is the case then you need to call MS and \p[en a support incident.  If  Microsoft determines that you are right about the
    patch not working you will not be charged for the call.
    I know that learning how to support technology is hard and frustrating for newcomers.  In time, by using these incidents to learn, you will become a seasoned technician and all of this will seem trivial.  Until then we can only suggest that you
    do things that most of us are familiar with.  We cannot fix your network for you.
    I think you haven't really posted in the GP forum but posted a question about GP in the server forum.  Try posting in the GP forum.
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverGP
    Here is one answer from the GP forum:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserverGP
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/600ca14f-8b1b-400c-b27f-a7f5733407ac/windows-scheduled-maintenance-task?forum=winserverGP
    ¯\_(ツ)_/¯

  • OpenScript: Which files to put under Version Control?

    Hi,
    According to JB's description of [how to enable Subversion|https://forums.oracle.com/forums/thread.jspa?messageID=10677356] for OpenScript, I have now an active version control.
    The next question is now: which files I should put under version control? Obviously, the script.java is a good decision, but there are many more, such as java, properties, but also specific folders like "recorded data" and "results" folder.
    Which once I should put under version control, any recommendation?
    Thanks a lot in advance!
    Volker

    Thanks for your replies,
    it's nice to know that I was going the right way.. :)
    But how do you handle these little bugs, that I mentioned in my first message? Do you check-out all files in the project before work? Or they are TeamSystem - specific?
    Best wishes, Serg.

  • Can't rename file under Subversion control.

    CS5 - Unless I'm missing something you can't rename a file (using dreamweaver to do so) and have it maintain it's connection to subversion. For example, if I rename a file using Dreamweaver, edit it, then go to "Commit" it, I get an error "File is not under Subversion Control". What is the correct way to rename a file in CS5 under subversion control?
    This is a serious deficit.

    Saving the file under a different name creates all sorts of problems. Especially since all the history of the changes are lost. DW provides a "rename" command but it doesn't update the files svn metadata. If you use the rename command it doesn't warn you that you will loose the connection to the repository.
    This must be a bug because an equivelent version of Tortise SVN DOES allow you to rename a file and preserve all the history. I just found this out and am using Tortise SVN to do the renaming. It's the same SVN version as DW so it updates the metadat just fine and it preserves the history of the previously named file.
    This is a bug in DW or a serious omission.

  • Could not save changes to this script because of a program error. -2706

    OK, this is very odd! Please try the following and let me know your results:
    1) Create a new script with the following example code:
    set testList to {}
    repeat with i from 1 to 8145
    copy i to end of testList
    end repeat
    2) Save the script as an Application (name it whatever you like).
    3) Launch the newly created Application and see if you get the same error message I am getting...
        *Could not save changes to this script because of a program error.*
        -2706
    If you replace the number 8145 with 8144 (or any number less than 8145) the script runs without error. Any number greater than 8144 returns the error message shown above. Maybe there's a reason for this that I'm overlooking or is this another bug?
    I looked up error code -2706 ([HERE|http://developer.apple.com/Mac/library/documentation/AppleScript/Concept ual/AppleScriptLangGuide/reference/ASLRerrorcodes.html]) which says it is a "*Stack overflow.*"
    Thanx in advance for any insight on this!!
    NOTE:
    The only workaround I've found for this is to make sure the script resets the variable before it quits. Like this:
    set testList to {}
    repeat with i from 1 to 8145
    copy i to end of testList
    end repeat
    set testList to ""

    Hey Pierre, thanx for taking the time to scratch your head with me!
    Very odd indeed.
    Glad it's not just me that thinks this!
    I've also noticed that the problem occurs even when you try to save the script as a compiled script. That's possible as long as you haven't run the script. Once you have run it, trying to save it seems impossible. You get the message: *“The document “Document title” could not be saved.”*
    I've noticed the same thing as you and have experienced this extra error several times while trouble shooting this problem!
    On the other hand, is there any good reason for which you would want to save such a big list? Are there any drawbacks to the workaround you've found?
    I don't want to save ANY variable EVER unless I explicitly tell my script to do so! This variable is not a property, so why would my script want to save it? I haven't noticed any drawbacks to the workaround. Setting the list variable to "" or {} (or ANYthing with under 8145 items) seems to work fine. I just find it weird that my script can't "*save changes to itself*"?! What is there to save? It's just a variable that should release after my script has run ...unless I'm completely misunderstanding how variables work after ALL these years of scripting.
    Btw, the following version of the script (as you probably already know) is much faster, although it doesn't change anything to the result:
    *set testList to {}*
    *set testListRef to a reference to testList*
    *repeat with i from 1 to 8144*
    *copy i to end of testListRef*
    *end repeat*
    Yeah, it definitely runs much faster this way! I just posted a quick example that would illustrate the 8144 list count limit. My script sets a variable to a list of numbers contained in a text file. This list is almost always rather large! Right now there are over 20,000 items in this list of numbers.
    Again, thanx for your time my friend!!

  • SAP-Script Control on a Dynpro

    Hello to all
    I am trying to implement a SAP-Script control on a Dynpro (a PA-Infotype) using the class CL_GUI_SAPSCRIPT_EDITOR.
    Basically this works pretty smooth but I am facing an odd problem:
    How can I determine that the user made changes to the text and I therefor need to save the Infotype and the content of the control? I found this suitable looking method IS_MODIFIED of said class which seems to return a boolean value that indicates wether there have been changes made or not.
    Sadly though this method always returns false.
    Has anybody a clue as to what needs to be done here?
    Cheers
    Markus

    I think, one should flush the changes before requesting the modification status.

  • Disabling Alarms under program control

    Is there a way to enable / disable certain alarms being generated under program control?  In the process I'm programming, under certain conditions, when there are maintenance operations occuring in the plant, certan alarms are guaranteed to occur, but have absolutely no meaning.  As the operations staff gets 'concerned' when they get alarms, is there any way to disable these alarms from being generated during periods when I know they are of no value?
    David Dudley
    [email protected]

    In this case you should use an Alarm Object (if you are not already). An Alarm Object is able to read particular conditions, before an alarm is generated. Perhaps you make a switch on the panel. The Alarm Object could read this switch and only generate an alarm if the switch is in the a particular position. Basically, giving you the ability to turn on and off the Alarm Generated by the Alarm Object. I have attached a small example of working with the alarm object. By editing the connections you can make the boolean switch make the numeric pot invisible, disabling its ability to be changed and thus disabling any alarms from being generated by it going out of range. This same sort of concept could be applied to your application.  
    You can also just change the alarm conditions programmatically so the alarm will not trigger.
    http://digital.ni.com/public.nsf/websearch/ED1ED5E​5B137995986256B9000730543?OpenDocument
    Attachments:
    alarm.zip ‏6 KB

  • How to change cursor when need to open a new dialog?

    Hi,
    I try to change cursor to WAIT when client open a new dialog, which it tell user the program was running to ready display new dialog.
    My code was like the following
    scene.setCursor(Cursor.WAIT);
    someclass.showMyDialog(); // The dialog was a new stage with StageStyle.UTILITY style
    scene.setCursor(Cursor.DEFAULT);
    But the cursor didn't be changed, I didn't know it why? Anybody know it? thank in advance!
    I had search the google, and didn't find the perfect answer, most of they was like to use setCursor(Cursor.WAIT) mode.
    the current ENV in my host was: windows 7 and Java
    java version "1.7.0_13"
    Java(TM) SE Runtime Environment (build 1.7.0_13-b20)
    Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)
    Best regards,
    Edited by: user13005878 on May 27, 2013 1:48 AM

    If you have a long running process ("long" means anything the user will notice), you need to run it in a thread other than the JavaFX Application Thread. In other words, you need to change the cursor to the wait cursor on the FX Application Thread, launch a user-defined thread for your long running process (connecting to the database), and once that thread is complete, show the dialog and change the cursor back on the FX Application Thread again. If you try to do everything on the FX Application Thread, you'll likely block that thread and prevent any changes from being visible to the user until the long process is complete (so you'll never see the wait cursor).
    All that said, and as jsmith said, there are some bugs in JavaFX 2.2 with the appearance of the cursor. So on my system (Mac OS X 10.7.5) the "correct" behavior is only observed with JavaFX 8.
    This is an example of doing things wrong. Here I don't see any change to the cursor, even on JavaFX 8:
    import javafx.application.Application;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Cursor;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.layout.BorderPane;
    import javafx.stage.Stage;
    public class WaitCursorDemo extends Application {
      @Override
      public void start(Stage primaryStage) {
        final BorderPane root = new BorderPane();
        final Scene scene = new Scene(root, 600, 400);
        Button button = new Button("Do something time-consuming");
        button.setOnAction(new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent event) {
            System.out.println("Starting...");
            scene.setCursor(Cursor.WAIT);
            try {
              Thread.sleep(2000);
            } catch (InterruptedException exc) {
              exc.printStackTrace();
            scene.setCursor(Cursor.DEFAULT);
            System.out.println("Done");
        root.setBottom(button);
        primaryStage.setScene(scene);
        primaryStage.show();
      public static void main(String[] args) {
        launch(args);
    }This works on JavaFX 8: after pressing the button I see the wait cursor for two seconds, then it reverts to the default cursor.
    import javafx.application.Application;
    import javafx.concurrent.Task;
    import javafx.concurrent.WorkerStateEvent;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Cursor;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.layout.BorderPane;
    import javafx.stage.Stage;
    public class WaitCursorDemo extends Application {
      @Override
      public void start(Stage primaryStage) {
        final BorderPane root = new BorderPane();
        final Scene scene = new Scene(root, 600, 400);
        Button button = new Button("Do something time-consuming");
        button.setOnAction(new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent event) {
            System.out.println("Starting...");
            scene.setCursor(Cursor.WAIT);
            Task<Void> task = new Task<Void>() {
              @Override
              protected Void call() throws Exception {
                try {
                  Thread.sleep(2000);
                } catch (InterruptedException exc) {
                  exc.printStackTrace();
                return null;
            task.setOnSucceeded(new EventHandler<WorkerStateEvent>() {
              @Override
              public void handle(WorkerStateEvent event) {
                scene.setCursor(Cursor.DEFAULT);
                System.out.println("Done");
                // Display your dialog now you have the data from the database...
            new Thread(task).start();
        root.setBottom(button);
        primaryStage.setScene(scene);
        primaryStage.show();
      public static void main(String[] args) {
        launch(args);
    }

  • Set cursor in table control field

    I have developed module using table control have done validation for one field on Enter key press.In change mode if user changes value in table control field and presses Enter key then system is showing Error message on status bar and table control gets gray out.
    if user again hits Enter key then this error message clears and Table control is in Edit mode.
    Here I wan that Cursor should go to same filed from which error message occurred.
    I have written Get Cursor In PAI event and Set Cursor in PBO after Loop at table control. I tried Set cursor within Lop at Table control in PBO.
    But cursor is not coming on that field of table control.
    I have written set cursor as below:
    Set Cursor Field itab-fieldname Line lineno Offset offsetval.
    Here itab is internal table assigned to table control.
    Please let me know why cursor is not setting on particular field on table control.

    Hi Ganesh,
       A simpler way would be to include the fields of the table in a chain-endchain block.
    in PAI section.
    PROCESS AFTER INPUT.
      loop at IT_FINAL.
        chain.
          field WA_FINAL-JOBCARD.
          field WA_FINAL-MATIDTAG.
          field WA_FINAL-VORNR.
          field WA_FINAL-ARBPL.
          field WA_FINAL-ZZPULLCONTNRQTY.
          field WA_FINAL-NOOFTAGS.
          field WA_FINAL-ROUTE_TO.
       module validate.
        endchain.
      endloop.
    you can issue your error messages in the module validate.
    REgards,
    Ravi

  • How do you create translated versions of a project under version control?

    Hi,
    We have a project under version control that has been translated. How do we best create projects for the translated material so that the webhelp output matches the English version only translated? Is it possible to create a project with a name that reflects the translated language, copy the English project file to the new folder, change the name to coincide with the translated version, import all of the associated English files, and then exchange all of the English files with the translated ones?
    Thanks,
    Allen

    Hello Allen and welcome to the community.
    See if this article helps.  You didn't mention which RH version you're using, but except for the features specifically called out as being in RH8, the process should work for RH7 projects.
    I use Subversion for version control, and I haven't had any additional challenges from having localized projects in version control—you check the files in and out as you do the English ones. Check out the article and let us know if you have any additional questions.
    Note that the article gives recommendations, but you certainly can do your localized versions as completely separate projects.  If you do it that way, for each separate project, copy the English project to a new location, rename it if you want, and change the project language.
    Hope this helps,
    Ben
    GryphonMountain.net

  • Microsoft Script Control

    I am importing a json file to Excel using Microsoft Scripting Controls.
    I am trying to set up several sheets within the workbook, where only one piece of data is the variant between sheets. However I can't get the Script Engine to reset from sheet to sheet. What do I need to do to have the script engine reset each time? Thanks
    Public Sub InitScriptEngine()
    Set ScriptEngine = New ScriptControl
    With ScriptEngine
    .Language = "JScript"
    .AddCode "function getProperty(jsonObj, propertyName) { return jsonObj[propertyName]; } "
    .AddCode "function getSubProperty(jsonObj, podId, propertyName) { return jsonObj.gallery.podCache[podId][propertyName]; } "
    .AddCode "function getKeys(jsonObj) { var keys = new Array(); for (var i in jsonObj.gallery.podCache) { keys.push(i); } return keys; } "
    End With
    End Sub

    I am trying to load different json from a web page into Excel. I want to use a different sheet for each zip code in one workbook. When I change the URL for the next webpage, example change
    http://www.coupons.com/ajax/init?zipcode=77477" to
    http://www.coupons.com/ajax/init?zipcode=33317"
    The data remains the same in the new Excel sheet.
    This is the complete code.
    Option Explicit
    Private ScriptEngine As ScriptControl
    Public Sub InitScriptEngine()
    Set ScriptEngine = CreateObject("MSScriptControl.ScriptControl")
    ScriptEngine.Language = "JScript"
    ScriptEngine.Reset
    With ScriptEngine
    .AddCode "function getProperty(jsonObj, propertyName) { return jsonObj[propertyName]; } "
    .AddCode "function getSubProperty(jsonObj, podId, propertyName) { return jsonObj.gallery.podCache[podId][propertyName]; } "
    .AddCode "function getKeys(jsonObj) { var keys = new Array(); for (var i in jsonObj.gallery.podCache) { keys.push(i); } return keys; } "
    End With
    End Sub
    Public Function DecodeJsonString(ByVal JsonString As String)
    Set DecodeJsonString = ScriptEngine.Eval("(" + JsonString + ")")
    End Function
    Public Function GetProperty(ByVal JsonObject As Object, ByVal PropertyName As String) As Variant
    GetProperty = ScriptEngine.Run("getProperty", JsonObject, PropertyName)
    End Function
    Public Function GetKeys(ByVal JsonObject As Object) As String()
    Dim Length As String
    Dim KeysArray() As String
    Dim KeysObject As Object
    Dim Index As String
    Dim Key As Variant
    Set KeysObject = ScriptEngine.Run("getKeys", JsonObject)
    Length = GetProperty(KeysObject, "length")
    ReDim KeysArray(Length - 1)
    Index = 0
    For Each Key In KeysObject
    KeysArray(Index) = Key
    Index = Index + 1
    Next
    GetKeys = KeysArray
    End Function
    Public Sub GetCoupons77477()
    Dim JsonString As String
    Dim JsonObject As Object
    Dim Keys() As String
    Dim Output() As Variant
    Dim lRow As Long
    Dim lCol As Long
    InitScriptEngine
    With CreateObject("MSXML2.XMLHTTP")
    .Open "GET", "http://www.coupons.com/ajax/init?zipcode=77477", False
    .send
    JsonString = .responseText
    End With
    Set JsonObject = DecodeJsonString(CStr(JsonString))
    Keys = GetKeys(JsonObject)
    ReDim Output(1 To UBound(Keys) + 1, 1 To 6)
    For lRow = 0 To UBound(Keys)
    Output(lRow + 1, 1) = ScriptEngine.Run("getSubProperty", JsonObject, Keys(lRow), "brand")
    Output(lRow + 1, 2) = ScriptEngine.Run("getSubProperty", JsonObject, Keys(lRow), "summary")
    Output(lRow + 1, 3) = ScriptEngine.Run("getSubProperty", JsonObject, Keys(lRow), "details")
    Output(lRow + 1, 4) = ScriptEngine.Run("getSubProperty", JsonObject, Keys(lRow), "expiration")
    Output(lRow + 1, 5) = ScriptEngine.Run("getSubProperty", JsonObject, Keys(lRow), "isuff")
    Output(lRow + 1, 6) = "77477"
    Next lRow
    ThisWorkbook.Sheets("Zip77477").Cells(1, 1).Resize(UBound(Output), UBound(Output, 2)).Value = Output
    End Sub

  • Putting jumpstart directory under RCS control

    I would like to have my jumsptart directory (or at least the human edited files, i.e finishing scripts, profiles etc.) under RCS control, but when I check in the top level files, my jumstart no longer works. I can't tell if it's a permissions problem or if the jumpstart process can't do it's thing while the files are controlled. Anyone know anything about this?

    i'm using cvs, and it works fine... the only things not checked in are check and *.ok
    are you using an rcs that adds comments or touches files?

Maybe you are looking for

  • Strange problem with voiceover recording

    This just recently started in iMovie 11. So I recorded a short voiceover clip in my project, and it didn't turn out the way I wanted, so I deleted it. I recorded another voiceover, hit the spacebar when I was done, and the PREVIOUS clip I deleted pop

  • Using Flash components as Widgets

    I'm liking much of the functionality (and prettiness!) gained by third-party Flash components (www.flashden.net, www.flashcomponents.net, etc) that I'd like to incorporate into Captivate lessons. Being a Flash and Captivate newbie, I haven't yet brok

  • Process Control Error in Workspace

    Hello Gurus, Please Help me in this ASAP. we have stopped our Production servers and in the process of up and running Disaster recovery servers. completed the following tasks. system configurationis successful registered the application successfully

  • ICloud match and Bluetooth issues

    When I connect to the Bluetooth in my car, I can't see or play the songs that I obtained from cd's (which were on my computer).  Why can't I play all the songs? I can play them if the ipad is not connected to Bluetooth??

  • External Hard Disk Issue

    I have a Seagate Free Agent external USB hard disk (250 GB) which I had reformatted to FAT32. This draws power from the USB port and seems to work perfectly on my Linux (Fedora Core 8) and Windows (XP) boxes. On the Mac, when it is plugged in, it ask