[JS, CS2] Is there a variable that contains the name of the calling script?

Hello

I need to have a script to get to know his own name.

It's because I have a situation where I have a find/replace routine to clean up and text style that I need to run on a few different types of stories (I work for a newspaper and they are in the sense of "default body copy," in the page","section of the arts", etc), but most of the routine of find/replace is the same for each of them.  My colleagues should be able to have each of the routines to be in different scripts so that they can click on them.  So I want each script specialist to have nothing in it but a statement #include that will be #include the text of a main entry.  That way, whenever I have to make changes, I can't save as 1 million slightly different versions.

So if I need to be able to determine the name (or the path) of the script that has been called, then the script can then perform some necessary specialized actions for this type of story.  Is it possible to do?

It would be something like the $argv php variable [0].

Thank you.

I don't think I understand what you mean by,

is it possible to pass parameters to the Indesign scripts directly (like the rest of the argv PHP array)?

Where these variables should come from? Please provide details.

You can send parameters to a script as in the following example (in examples of javascript)

DoScriptParameters.jsx
A JavaScript InDesign CS3
//
Shows how to send parameters to a script called for help
the doScript method.
var myParameters = ["Hello from DoScript", "Your message here"];
var myJavaScript = "alert (\"First argument:------"arguments [0] + \"\\rSecond argument: \ "+ arguments [1]);"; "
app.doScript (myJavaScript, ScriptLanguage.javascript, myParameters);
If (File.fs == "Windows") {}
var myVBScript = "msgbox arguments (1), vbOKOnly, \"First argument:------"& arguments (0) ';
app.doScript (myVBScript, ScriptLanguage.visualBasic, myParameters);
}
else {}
var myAppleScript = "say the application \"Adobe InDesign CS3_J\\rdisplay dialog box (\"First argument\ ' & point 1 of arguments & return & \"Second argument:------"& point 2 of arguments & return & end say" ';).
app.doScript (myAppleScript, ScriptLanguage.applescriptLanguage, myParameters);
}

Tags: InDesign

Similar Questions

  • Variable that contains the current URL of apex

    Greetings,

    Is there a variable that contains the current URL of Apex? I would like to be able to access the current URL in a PL/SQL block.

    Thank you

    Larry

    See + {: identifier of the thread = 1021135} +.

  • Creating a variable that contains the value of the variable system (Long) Date of change

    Can someone tell me how to write a script to create a variable named DocDate, which contains the value of the variable of system (Long) Date of change? Or write a script that creates a variable named DocDate, which contains the current date? I can't find a lot of documentation on scripting ExtendScript.

    Hi Julee, when you create a user variable in the interface, you cannot include the building blocks of time in the definition. They can only be used in system like the System Date of Modification (Long) variable variables. So the question is, why not just use the variable Date of change (Long) system in your document? What is the purpose of the variable user DocDate? Let me know what you think here, and I can try to help you.

    Here are some ExtendScript resources:

    My blog: FrameAutomation.com | FrameMaker, faster and more effective to

    Debra Herman blog: Extension of FrameMaker

    The large samples of Russ Ward: FrameMaker ExtendScript samples - West Street Consulting

    -Rick

  • cfoutput of a variable that contains the logic

    I have currently a logic that is stored in a table, and when I try to run the code in a cfoutput it does not perform logic as if it was online.

    < cfset middlename = "2" >
    < cfset var1 = "< cfif len (middlename) eq 1 > #middlename #, < cfelse > #middlename # < / cfif >" >
    < cfoutput > #var1 # < / cfoutput >

    This outputs
    2.2
    instead of 2 or 2

    I currently have a logic that is stored in a table, and when I try to run the
    code in
    a cfoutput it does not perform logic as if it was online.



    #var1 #.

    This outputs
    2.2
    instead of 2 or 2

    You are not allowed to nest tags inside the media other tags such as
    which. If you look at the source in your browser, you want it as
    in fact out all of the code"
    1 > 2,2 ", but the browser ignores the tags <...>it
    does not understand and does render is not the part of the string. Then
    everything you see in the window is 2.2.

    For this example, you can use the function #iif () #.

    But for your original question, to run code that is stored in a database
    You'd use the evaluate() and | or de() [assess deadlines]
    functions. See the documentation for these functions.

  • The feature you are trying to use is on a network that is not available. Click OK to try again or enter a different path to the folder that contains the installation packagr 'TrayApp.msi'

    Original title: trayapp

    When I open the computer message appears, the component you are trying to use is on a network that is not available. Click OK to try again or enter a different path to the folder that contains the installation packagr 'TrayApp.msi' in the box below.
    C:\Users\user\AppData\Local\Temp\7zS5216\setup\TrayApp\
    When I click ok the message this way that c:\users\user\appdata\local\temp\7zs5216\setup\trayapp\ is not found. Verfy that you have access to this location and try again or try to find the 'TrayApp.msi' in installing a package file from which you can install the product'TrayApp.
    When I try to cancel the warning message, is that an installation package for the TrayApp product is not found. Again the installation again using a valid copy of the 'TrayApp of installation' package. I already uninstalled all HP products, but this message is still bothering me, how to solve this problem?

    Hey Tama,


    -What version of windows is installed on the computer?
    -Have there been recent changes to the computer before the show?
    I recommend you go through the next HP document and check if it helps.
    Hope this information is useful.
  • Printing of documents that contain the letter and legal-size pages - Laserjet 600 M602

    We have a printer Laserjet 600 M602, that does not automatically select a tray to print every time someone tries to print a document that contains the letter so many pages of legal size.  The default printer for the Tray 1 (Manual power) and the user will have to walk over to the printer and the printer to select the correct tray.  I went in the printers settings via the web interface and I set the tray settings to the following: Tray 1 - any Type of Size/Any, bin 2 - letter/plain, plateau 3 - legal/Plain and it still does not print correctly.  Unfortunately for the printer settings, it was on that I'm comfortable doing.  I read the print driver may have changed, but we use the driver included with the disc and I guess that it would be sufficient that this driver.  Does anyone know of some setting that I might be able to change the printer or if it is indeed a print driver problem?  Any comments would be appreciated.

    Thank you

    I was able to receive help this morning from HP support.  He turns out, there were two things that I needed to change.  The first is that when printing from a pdf file, there is an option in the print area for "Choose paper according to the size of PDF page source" and the second thing, it was with the printer printing preferences.  In the printing preferences, under the "Printing shortcuts" tab, the paper Type has been set to Prepunched.  We changed this Unspecified.  After making these two changes, the user is able to print correctly in the printer.

  • Sort the listBox that contains the text and numbers

    Is there a script to sort a listBox control that contains the text and numbers using a button?

    I would have preferred that he sort 1, 2, 10, 20, 100, not 1, 10, 100, 2, 20

    Examples are part numbers: HP1457100-9, 011-2025-479, 85216, etc.

    You may need to change this line:
    oTarget = this,

    It refers to the object to display the results.

  • How to get a paragraph that contains the string selected in FDK?

    Hello

    I am writing a program that extracts content of the paragraph that contains a selection string. This program runs in the interaction point menu. When the user click on the menu item. The process as follows:
    1. find a chain on a document, for example: F_ApiFind ("ABC").
    2. the F_ApiFind ("ABC") API returns the F_TextRangeT structure.
    3. the string "ABC" has been highlighted on the document.

    Here's my question:
    How can I write code to locate an object ID paragraph (pgfId) that contains the string (or object) 'ABC '?.
    As the 'ABC' object belongs to the current paragraph, how can I get section ID (pgfId) and then get the content of the entire paragraph
    without a loop through FP_FirstFlowInDoc, FP_FirstTextFrameInFlow, FP_FirstPgf and FP_NextPgfInFlow.

    Thank you very much for you help,

    Thai Nguyen

    Hi thai,

    Paragraph ID is returned as part of the structure of F_TextRangeT, as the Member "objId". Let's say you have:

    F_TextRangeT tr;

    ... then:

    TR = F_ApiFind (...);

    On an action to search with success, "tr" will contain the pgfId of the paragraph. I'm assuming you're looking for a string that is entirely contained in a paragraph, in which case two ways contains the ID of the paragraph:

    tr.beg.objId

    TR.end objId

    If you want to retrieve all the text in the paragraph after the search, you could do something like: (attention, incomplete code!)

    F_TextItemsT ti;

    F_TextRangeT tr;

    F_ObjHandleT docId.

    ...

    TR = F_ApiFind (...);

    TR. Beg.offset = 0;

    TR.end.Offset = FV_OBJ_END_OFFSET;

    TI = F_ApiGetTextForRange (docId, & b, FTI_String);

    .. After that the text of the paragraph will be included in the ti TextItems structure. Navigate through this structure can be difficult and I will renounce any discussion about it for now unless you need more help. There is good information in the developer reference as to its use.

    Russ

  • I downloaded an e-mail that contains the music, I deleted the email, but the music continues to play despite having deleted the history etc.

    I down loaded an e-mail that contains the music, I deleted the email, but the music continues on whwenever game that I connect despite having deleted the history etc.

    {Ctrl + J} t0 open downloads window. Right click on this audio file, and then click remove from the list of

  • Cell that contains the formula paste between spreadsheets

    How do I paste the value of a cell that contains the result of a spreadsheet formula has, in a worksheet cell B and still have the operation of the formula? OS 10.11.14, numbers 3.6.1.

    Hi dad,

    It depends on what you mean by "still have the operation of the formula."

    If simply paste you it into a new table in another document, the formula will be stuck more or less intact, but it will not reference all the cells on the original table. If he refers only the cells on the table where he came from, he can refer to these same cells or cells in the same position relative to the new location on the table to which it is glued. You will have probably the best success with her work on the new table, if you copy and then paste the formula itself, rather than the containing cell.

    Repeat what I have not quite clear in the first line: the numbers documents cannot reference cells in other documents of numbers.

    Kind regards

    Barry

  • How to create a formula that highlights the cell that contains the same data that I type in another cell

    Hi, can someone help me make a formula which detects and highlights the value of the cell that contains the items of data that I entered in another cell? Thank you

    resolved to myself

  • Where does FireFox get the default value for a preference of. What is the format of the file that contains the default value?

    Where does FireFox get the default value for a preference of. What is the format of the file that contains the default value? I need the actual default value for an individual preference.
    Topic: config shows some default values, but I need the source from which everything: config returns to the default value.
    Any help in this direction is greatly appreciated.

    User Agent

    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x 64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)

    The preferences that are not hidden if they have by default are stored in two JavaScript text files in the Firefox program folder
    You can open them in a tab in Firefox through these links:
    resource:///defaults/pref/firefox.js
    resource:///greprefs/all.js

    (702598/forum/1/702598)

  • Hi, I use iTunes 12.3.2.35 on a Windows 7 computer. I don't seem to be able to import files from a CD that contains the files on it as mp3 files. If I launch iTune and then put the CD in, it doesn't appear and I can't drag and drop.

    Hi, I use iTunes 12.3.2.35 on a Windows 7 computer. I don't seem to be able to import files from a CD that contains the files on it as mp3 files. If I start iTunes and then put the CD in, it doesn't appear and I can't drag and drop.

    It would not seem like an audio CD, as a drive in this way is a data disc when it contains mp3 files. You would need to access the file menu in iTunes, manage files here. If you manually manage music, you will need to access it as a regular folder on your computer. In iTunes, go to file > add file to library, and select individual files.

  • I can't read a CD that contains the UDF files on my Windows 7 system.

    I can't read a CD that contains the UDF files on my Windows 7 system.  When I try to open them, I get a message saying that I need a special software to fix it. but when I try to download this software (C2UDFFS. (SYS) I get "cannot copy file in the destination directory."  Would be grateful for any help.

    Try this link: -.

    http://support.Microsoft.com/kb/975617

    It will be useful.

  • Prepare a document to insert a row that contains the Blob column. Is what sense this correct?

    When we prepare the statement to insert a row that contains the Blob column. Is what sense this correct? And what is the difference? Does anyone know?

    1 Preparestatement.setBlob(parameter number, blob type object)

    2 Preparestatement.setBlob(parameter number, inputstream type object)

    This link shows the test I did.

    https://community.Oracle.com/thread/3680185?SR=Inbox & customTheme = OTN

    When we prepare the statement to insert a row that contains the Blob column. Is what sense this correct? And what is the difference? Anyone know?

    1 Preparestatement.setBlob(parameter number, blob type object)

    2 Preparestatement.setBlob(parameter number, inputstream type object)

    I answered in your other thread and provided a link to the JDBC Dev Guide section, which explains how to work with type LOB and BFILE data.

    Have you read this article from doc?

    Did you read my response to your other thread?

    In java, a BLOB is just the index that gives you access to the content. In your case, you access by selecting a locator BLOB existing and getting his inputstream. This inputstream is what allows you to access the content real blob.

    The Locator is just that; It specifies the LOCATION of the blob content, but NOT the content.

Maybe you are looking for

  • Airport Express as a bridge for cable internet and wifi

    Hello My first post and I hope you can help, because I was not able to get a clear answer to my question, but it's perhaps easier to write I have an airport extreme for wifi, it's in a piece of my house. Airport extreme, I have an ethernet cable to m

  • Satellite P300 - 19 p: media control need to press several buttons times

    Hi all, I'm a newbie on this forum, but I like my Toshiba products! I recently received a P300 19 p and touch sensitive environments on the high keys buttons (Media Player to mute, open, play/pause, stop, previous, next) work, but only when I type th

  • My computer stops just after I turn it on

    The lights come on for a few seconds only. I have everything turned off (sector & the switch of the computer in the back) before trying again. I use Windows XP.

  • I don't get "Windows could not search for new updates"

    Hello useful friends. It is a brand new Windows 7 Ultimate SP1 installation (bare metal).   Nine news coming from XP, the drives were erased, product is turned on, and I get this error... I found many things on this forum, but nothing that makes me g

  • Normalized whitespace can work with numbers?

    I tried to use standardized spaces to get the spacing between a Word and a number and I realize it only works for the inter-mot spacing.  For example:NET45NET 45Is there a way to do this without doing replacement treatment?