[JS CS5.5] Complex application context want current script was called from

I am trying to create a somewhat sophisticated application that spans multiple script files.  Call some functions in these files is another.  Here's what I want to imitate:

A.jsx

--------

{if(mainScript=="A.jsx")}

doA();

}

function A() {}

B.jsx

---------

#include A.jsx

{if(mainScript=="B.jsx")}

doB();

}

function {B()

a few things

A() ;

stuff more

}

C.jsx

#include A.jsx

#include B.jsx

#include D.jsx

main() {}

D() ;

A() ;

etc...

}

Basically I want a script to act differently depending on whether it's the only be called or if it is called also. I thought I could do it quite easily using global variables and something like:

{if(mainScript==undefined)}

var mainScript = $. Filename;

}

But global variables persistent between script calls if it does not work. I'm kinda stuck.  Someone knows how to do this?  app.activeScript does not work because I am running through the extendScript Toolkit.

I'm offended.

#targetengine "session".

#strict on

Yes, they cause your script runs in a persistent engine called 'session', which means global variables will persist (it must be a * much * more careful with them), and also windows and hooks and eventListeners can persist after the execution of the script appears to complete.

If you do not need these things, and then deleting the targetengine line can be a good idea.

But on the other hand, the discipline, you get persistent global vars should be good for you. But probably not good enough to outweigh the problems that you have...

Tags: InDesign

Similar Questions

  • There is a problem with my payment information and I can't configure any application I want to remove my information from my icloud account payment

    There is a problem with my payment information and I can't configure any application I want to remove my information from my icloud account payment

    There are no withdrawal, must be replaced and released.

  • Device from the Application context context

    I am a beginner to programming of Blackberry and I'm trying to understand the different between developing countries in the device against the Application context.

    My development so far has just been messing around with the listeners and figureing on their functioning on the eclipse Simulator

    My current test project consists of a phonelistener that simply writes to console when a phonelistener event is fired. I think that my project as a module system, where this is not really an app its just something that I want, running in the background. But perhapse I think about evil.

    I have my project to "autorun". Now, what are the benefits to my project to extend the Application?

    at the moment I just:

     CustomPhoneListener extends AbstractPhoneListener
    

    It works fine and I can see the console outputs when I simulate phone calls. I know that my sample program is very simple, but can someone shed some light on what problems might come with not extending "application"?

    Thank you

    Stephanie

    Device vs. request context has no meaning for me.

    Each Application has its own context, says Simon if you use a listener usually perform you in the streamed Application context too.

    Re the difference between

    CustomPhoneListeners extends the Application Implements PhoneListener
    and

    CustomPhoneListeners implements PhoneListener
    I would ask you to think about this:

    CustomPhoneListeners extends String Implements PhoneListener

    What is the advantage of the extension of string?  Not really, except in certain circumstances, you need to treat your CustomPhoneListeners as a string!  Same thing with Application, if you want to treat like your own Application, then you might want to code

    CustomPhoneListeners extends the Application Implements PhoneListener
    Personally, I think that you don't want to have an Application also act as a PhoneListener, this does not seem a useful merger.

    About the benefits of creating an Application, it has no value extending the Application If you can work in the listener.  But you can do a treatment long, or perhaps a network call.  Or maybe you are not sure of the reliability of your code.  If you run this in the context of the phone, then if he dies or hangs, it is the phone that is killed.  Not good.  Then you can consider extending the Application, it is started (enterEvent Dispatcher), and then you can pass things for her to run.

    Personally, I do as little as possible in the headphones.

  • Global Application contexts - where to set the identifier of the customer?

    Hello



    I try to use contexts of global application in the context of an implementation of fine-grained access control.
    It is an e-Business Suite environment, more precisely of CRM, is a multilevel environment.
    Users access the two screens and OA framework based forms.

    I think I need to use the global application contexts because users can have multiple database sessions.
    In addition, all users login using the same database connection account.

    As much I can define a unique identifier for a user who persists throughout all their sessions I do use set_context settings, username and client_id below: -.


    DBMS_SESSION.set_Context (namespace = > 'XXUOM_CONTEXTS',)
    attribute = > "EXEMPT_FROM_VPD_POLICIES"
    VALUE = > l_exempt,
    username = > USER,
    client_id = > pi_user_id);


    The problem I have is to find a suitable place to set the client identifier.

    I don't know if the value is to be eliminated by another code or if the value is not used in all sessions.


    I use: -.


    DBMS_SESSION. Set_Identifier (pi_user_id)


    The tables that I call after insert triggers either icx_sessions or fnd_logins.


    However, the identifier of the customer is always null when I question him within the application, through: -.


    SELECT SYS_CONTEXT ('USERENV', 'CLIENT_IDENTIFIER') of double


    If I put the value via a rule of customizing a form, the value remains.




    I would be very happy if someone can advise me on where I'm wrong.




    Andy

    Thanks a lot for the pointers. Add DBMS_SESSION. SET_IDENTIFIER (FND_GLOBAL. User_name) does the work.

    Good.

    I want to say that this is the solution to my problem, but I am hesitant on the change in package FND_GLOBAL that there is no guarantee that it will not be overwritten by Oracle as part of a future patch/upgrade.

    It is not supported and it will be overwritten for sure.

    The patch proposed in [ID 1130254.1] is no longer exists.

    Log an SR to get this fix (or a replacement).

    Thank you
    Hussein

  • Can I build a complex application like TaskRabbit using Adobe PhoneGap?

    Can I build a complex application like TaskRabbit using Adobe PhoneGap?  When someone asks someone else to accomplish a task for them, the money gets treated and held, and then the money is transferred once the task has been carried out and confirmed.

    "Can PhoneGap do xyz" issues can largely answered "Yes." Where it falls down is usually when the qualities and constraints are added. For example, you can build a Minecraft-like game to PhoneGap? Yes. Can you make such that it has the same performance as the equivalent written in C? Almost certainly not.

    Regarding your question, PhoneGap will only be part of the equation, as you must have/interface with a backend to track the completion of the task, funds on deposit and initiate transfers. Then, PhoneGap can do /part/ this? Yes. He can do all this? N °

    Of course, this answer would be the same even if you asked a native application. An application running on the client side can do - an app of this type would require some kind of backend to track everything.

  • Adobe Application Manager wants my password and I don't have one, never need one. Ive tried every password I know and I don't know what to do now.

    Im trying to update 6 Lightroom and Adobe Application Manager wants my password and I don't have one, never need one. Ive tried every password I know and I don't know what to do now.

    It calls not just for login password for your computer so that it can install your software?

  • Update CS5 with Adobe Application Manager.

    I tried to update CS5 with Adobe Application Manager. But after downloading the files, he immediately stopped saying "update is not a success, failure to download the file, stop the program and later it starts again." No code or somethinh else. The system is Win8.1. Does anyone has a tip?

    Hello

    Please try to download the update from the product updates

    Kind regards

    Sheena

  • I use the trial version of CS5 version, two years ago. I was deleted from my computer after using the program. Now, once again I want to install a trial version of CS5 on my computer. I want to improve my program information. That copyright law is there a

    I use the trial version of CS5 version, two years ago. I was deleted from my computer after using the program. Now, once again I want to install a trial version of CS5 on my computer. I want to improve my program information. That copyright law are there downsides to the wonder of Adobe?

    Hello

    Please Download CS5 products

    But you can only use it as a trial for a limited time unless you do not provide a serial number to activate the product.

    Kind regards

    Sheena

  • I'm so frustrated!  I have CS5 Master Collection.  I want to UPGRADE to CS6 Master Collection.  I want to be on the cloud!  I can't find where to put up-to-date or any CONTACT to ask for help.  It shouldn't be this hard.  HELP Please!

    I'm so frustrated!  I have CS5 Master Collection.  I want to UPGRADE to CS6 Master Collection.  I want to be on the cloud!  I can't find where to put up-to-date or any CONTACT to ask for help.  It shouldn't be this hard.  HELP Please!

    See the link below:

    Creative Suite 6

  • I'm a newbie here, but I don't see the applications I want download, only this message "Welcome to Creative Clouds."

    I'm a newbie here, but I don't see the applications I want download, only this message "Welcome to Creative Clouds."

    Hi Leigh,

    Please download from the link:

    https://creative.Adobe.com/products/creative-cloud?promoid=KLYVF

    I hope this helps.

    Concerning

    Megha Rawat

  • I own the CD version of CS5 Production Premium. I want to only download Premiere Pro - not the entire suite. Can I do this?

    I own the CD version of CS5 Production Premium. I want to only download Premiere Pro - not the entire suite. Can I do this?

    You must get through the following programs.  You should be able to select what programs get installed when you install the Suite, if you only want to Premiere Pro so make sure that it is the only one selected.

  • [CS6] Download the version of the application in which the document was created

    Hi all

    Is there a way to get the version of the application in which the document was created?

    For example: I have a CS6 plugin in which I want to know if the current document has been initially created in CS3 or CS5 or so away.

    Any help will be much appreciated.

    Use IMetaDataAccess from IDocument.

  • Error in Windows Media Player, Windows Media Player is not installed correctly and must be reinstalled. You want to install the Player from the Microsoft Website

    I don't know how or why it happened, but one day to another, WMP won't open. I tried to open an MP3 file, and he says that WMP has not been correctly configured "Windows Media Player is not installed correctly and must be reinstalled. Do you want to install the player from the Microsoft Website? ».

    I assumed that since I had to make some updates yesterday, that he was at fault, it had installed an update/new version of WMP and it was either buggy or doesn't work do not, so I went to the Windows updates, but no recent updates on the list had a remote connection with Windows Media Player.

    So, I accept the first proposal of the error message, and I'm headed to the Windows Media Player download page on the Microsoft Website. However, the version I should install (which was the one I already had) has Windows Media Player 12 for Windows 7. But this option is locked for me, and as I tried to install it, it says it is not compatible with my system. Not to mention, it's a whole package and not just the WMP installation.

    I tried everything and nothing seems to work. It won't even let me uninstall WMP because it won't let me open.

    My OS is Windows 7 Home Premium 64-bit. And the error messages that I get to try to launch any WMP feature (the tool, the installation program, no matter what), opens an error window stating that "there is a more recent version of Windows Media (12.0.7601.18150) player already installed on your computer. It is not possible to use and more old (12.0.7601.17514) installation package to install files or repair your current version of the reader. »

    Please, I ask for any intervention in this case.

    This arises from time to time, but I don't think that there is a difficulty of 100%.

    You can try (in no particular order)

    1. uninstall, reboot, reinstall WMP- http://www.howtogeek.com/howto/26107/how-to-reinstall-windows-media-player-in-windows-7-to-solve-problems/ if that doesn't help, try a SFC/scannow check - http://support.microsoft.com/kb/929833
    2. There is this diagnostic tool - http://support2.microsoft.com/mats/windows_media_player_diagnostic/ that can help (from http://support2.microsoft.com/fixit/en-us?wa=wsignin1.0 )
    3. You could try a system restore to a date before the problem occurred to see if that helps - http://windows.microsoft.com/en-us/windows/system-restore-faq#1TC=windows-7 and see if it gets a WMP work back
    4. Last resort, a repair install - http://www.sevenforums.com/tutorials/3413-repair-install.html
    5. Or just simply forget about WMP and try another party 3rd multimedia player that you can install and uninstall at will, as free VLC - http://www.videolan.org/vlc/

    But it may be worth waiting a while to see if someone else has a better solution.

  • Why almost all javafx methods must be called from the thread of the application?

    I have a pretty big 3D scene that is refreshed every few seconds.

    It takes a while to update the scene, and I wanted to do it in a background thread.

    Problem is that almost every approach I take requires the application-fx thread.

    Now, I understand that change the UI itself must be called in the application thread, so I tried a different approach:

    Create a new group, add all the nodes (which takes the greatest amount of time) and update the component root of the view with the new group.

    I assumed that only the last party required the application thread, but alas this was not the case.

    group.getChildren () .add also requires that the thread of the application. Why?

    node.setLayoutX () also requires that the thread of the application. Why?

    It is a new set of nodes that are not visible and groups yet, so why can't do this in a background thread?

    The reasons of principle (I think) that JavaFX is mainly a single toolbox threaded are described in:

    https://weblogs.Java.net/blog/2004/10/19/multithreaded-toolkits-failed-dream

    That said, if you manipulate objects that are not part of an active scene, then it should work.  The dream that failed has what to do with the components who participate actively in the molten, interactive GUI.  If you're interacting with only the components out of the screen, then it (should be) without issue.

    Please, create and post an example minimum, executable that replicates the question.

    (Please ensure that the example is minimal and executable).

    In addition, what is the cause as your application "takes some time to update the scene?  Computers are today quite incredibly fast.  Of course, there are valid reasons for some things take time, I wonder what these are in your case.  What is the time?  If your executable example can include something reasonably representative of what you're done which shows something that will take "some time", would be great.

    What you have described so far, I feel that, even if there is no problems with threads, your proposed approach would not fix your performance problem.

  • I want to uninstall Lightroom 4 from my mac and then reinstall?

    I want to uninstall Lightroom 4 from my mac and then reinstall?

    Go to Applications and move the Lightroom folder to the trash and then reinstall it from the dvd or download link. Be sure to back up your catalog just to be safe.

Maybe you are looking for