How to copy a JS variable to the clipboard

I have a script that determines the distance between two guides.
I would like that variable to be copied to the clipboard so that a user can enter it into the control panel if one wishes.
The copy() function will only copy something that is selected in the ID file itself.
Any hints on how to start?
Thanks,
Tom

Hello,
I took up try67's suggestion because I cannot find any property that will copy to the clipboard.
The following works fine...for one number! A five digit number with a decimal (or even just two digits) overflows the text box. Text that overflows cannot be selected.
I think that the easiest solution is to make the pointSize of the text really small but for the life of me I cannot decipher how to do that.
Any suggestions on adding one or two lines to solve this? I figure the best place to put this property is in the frameProps property record.
Tom
var a = 7;
numToCopy(a);
function numToCopy(numToCopy){
var frameProps = {contents:numToCopy.toString()}
var myTextFrame = app.activeDocument.textFrames.add(frameProps);
myTextFrame.words.everyItem().select();
app.copy();
myTextFrame.select();
myTextFrame.remove();
}//end function numToCopy

Similar Messages

  • How do I set a variable on the main timeline from within a symbol?

    Just getting started with Animate and coming to it from Flash, as may be apparent from my question. How do you set a variable to the main timeline from within a symbol?
    I have 24 pairs of clickable elements, each in their own symbols, and all 24 of those symbols sit inside another symbol. I want all 24 to be able to set the same global variable when clicked. I can't find that this question is addressed anywhere, which makes me think I may be stuck in a Flash mindset and approaching the task in the wrong way. (There are however MANY discussions of how to address objects at different levels in the hierarchy. That's well covered.)
    Relatedly, how do you access a function on the main timeline from within a symbol?
    Adobe should consider putting together a support page (or pages) just for folks migrating form Flash. In the materials I've encountered so far there seems to be a studied effort to refrain from mentioning Flash in any way. I imagine there are a lot of people out there like me who have a deep background in Flash coding, but are just getting started with Animate. We don't need help with most of the basic concepts, but we may still have some pretty basic questions about how to accomplish some things in Animate because our Flash knowledge is getting in the way.

    Hi Bill,
    There are plenty of threads on here about scope, but here's one way to create a global variable:
    // code on Stage.compositionReady
    sym.myGlobalVar = 1;
    Then, anywhere in your project, you can check/set that var like so:
    sym.getComposition().getStage().myGlobalVar = 2;
    And here's one way to create a global function:
    // code on Stage.compositionReady
    sym.myGlobalFunction = function(){
              console.log('myGlobalFunction');
    Then, anywhere in your project, you can call that function like so:
    sym.getComposition().getStage().myGlobalFunction();

  • How can I pass environment variables to the child process?

    How can I pass environment variables to the child process? This is what I tried and it didn't work.
         static public void main (String[] args) throws Exception {
              ProcessBuilder b = new ProcessBuilder("java", "-cp", ".", "Child");
              Map<String, String> map = b.environment();
              map.put("custom.property", "my value");
                 b.redirectErrorStream(true);
              Process p = b.start();
              BufferedReader reader = new BufferedReader (new InputStreamReader(p.getInputStream()));
              String line = null;
              while (null != (line = reader.readLine())) {
                   System.out.println(line);
         public static void main(String[] args) {
              System.out.println("The value of custom.property is : " + System.getProperty("custom.property"));
         }and the result is:
    The value of custom.property is : null

    Complete test:
         static public void main (String[] args) throws Exception {
              ProcessBuilder b = new ProcessBuilder("java", "-Dcustom.property=my property value", "-cp", ".", "Child");
              Map<String, String> map = b.environment();
              map.put("custom.property", "my environment value");
                 b.redirectErrorStream(true);
              Process p = b.start();
              BufferedReader reader = new BufferedReader (new InputStreamReader(p.getInputStream()));
              String line = null;
              while (null != (line = reader.readLine())) {
                   System.out.println(line);
         public static void main(String[] args) {
              System.out.println("Property value of custom.property is : " + System.getProperty("custom.property"));
              System.out.println("Environment value of custom.property is : " + System.getenv("custom.property"));          
         }

  • How to copy RKF and to change the techincal name ?

    How to copy RKF and to change the techincal name ?

    Editing restricted key figures:
    Note that when you change a restricted key figure, these changes are effective in all queries that use this restricted key figure.
    You can see where the restricted key figure is used. Choose Where-used List from the context menu of the restricted key figure (secondary mouse click).
           1.      In the InfoProvider objects display frame, select the restricted key figure and, from the context menu (right-mouse click), choose Edit.
           2.      Make the required changes.
           3.      Choose OK.
    Pl. refer following link on help.sap.com
    http://help.sap.com/saphelp_nw04/helpdata/en/61/d0b143aa26b849b4e79a859ea1d7d1/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/2a/eabc3d9ecc6b3be10000000a114084/content.htm
    Regards,
    DN

  • How do I put an alias of the clipboard on my desktop?

    On occasion I would like to see the contents of my clipboard, and is would be convenient to have an alias easy to access, such as on my desktop.
    At one time I did put a clipboard icon on my desktop but somehow I managed to loose it. Maybe I inadvertantly trashed it. Now I cannot find the clipboard anywhere, even using Spotlight. How do I put an alias of the clipboard on my desktop?

    HI Brian,
    I don't think that you can.
    The Clipboard is a pointer to an area of active memory where items are temporarily stored. Although some applications include a "Show Clipboard contents" menu item, AppleWorks does not appear to be one of them.
    Within AppleWorks, you could show the contents of the clipboard by opening a new WP or Draw document, and using this as a clipboard viewer—go to the new document, paste. Then if you're using the new doc only to view what's on the clipboard, press delete to clear the document (but not the clipboard). Otherwise, leave the item in the document, which will then serve as a 'multi-item' storage space.
    Regards,
    Barry

  • How to put a javascript  variable containg the i18n key  in the i18n tag

    I have a list of values in a List box.when the user selects a praticular value.,i need to show the java script localized alert message for the selected value.
    how can i pass the javascript variable to i18n tag.
    For ex:
    function test(){
    var selectedvalue='name';
    var localizedstring='<i18n:message key="+selectedvalue+"/>';--This is not working
    alert('<i18n:message key="+selectedvalue+"/>');
    the alert message is a blank string,even though i have the key in my resource bundle.
    Also..if i give directly pass the key value to i18n string it works. like..
    var localizedstring='<i18n:message key="+name+"/>';--This is  working
    *(am passing the variable value)*

    The following should be able to pass ans.
    <script language="Javascript">
    function check_answer(ans) {
    if (testing.result.value==ans ){
    window.alert("You have got 10 marks.");
    </script>
    <body>
    <form name="testing"...>
    <%
    ResultSet rs = stmt.executeQuery("select * from level where...");
    while(rs.next())
    out.println("<tr>");
    out.println("<td>" + rs.getString("question") + "</td>");
    ans = rs.getString("answer");
    out.println("</tr>");
    out.println("<input type='text' name='result'>);
    out.println("<input type='button' value='Enter' onclick='check_answer('<%= ans%>')'>");
    %>jag

  • How to use customer exit variable in the report

    Dear All,
    i want to use a standard customer exit variable in the report properties.
    In the Bex Query Designer right hand bottom you will find two buttons "Properties" and "Task". Click on task you will get different option. Choose properties from there and then select "variable sequence tab".
    I need to add a standard variable there. How can i achieve it?
    Appreciate your early help.

    You need to add variable to corresponding charctertic then you can get that varaible for sorting the sequence....
    If 0CUST is the varaible then you need to assign it 0CUSTOMER then 0CUST will be available for the sequence.
    Edited by: shanthi bhaskar on Apr 2, 2009 5:41 PM

  • How to Copy Service request Notes to the new Service request

    Dear Experts
    I have to write code for copying the service request's notes filed value to the new service request when User clicks on copy button.
    Fields in the Heard are getting copied when user copies to a new service request. But notes filed are not getting copied.
    Please suggest the available options for coding / configuration to achieve this.
    Regards
    Hanu
    Edited by: Hanu Madhava on Dec 14, 2011 12:05 PM

    Hi,
    The thing is like this....
    i have a released request in which we have more than 1200 objects, in that i dont need 10 objects.
    so when i create it as copy of transport request, i just deleted those 10 objects and saved.
    Now, if i transport the new request how many objects will go? 1200 or 1190?
    in the new request i am getting the old request under Comment: Object List Included.
    is it necessary to transport the old request?
    i need to transport only 1190 objects.
    Regards,
    Satish Reddy.
    Edited by: Sathish Reddy on Jan 28, 2010 2:18 PM

  • How to print a request variable in the name of a section?

    Hello all,
    I have a session variable created in the RPD called VarWorstStore
    and I have a prompt which sets a request variable with the same name.
    Now when I put a report which is filtered on this variable then I can see that the variable is changing when I press go in the dashboard prompt.
    However, I call this variable in a section as well (go to page options - edit dashboard and click on rename of a section)
    Now I type: @{biServer.variables['NQ_SESSION.VarWorstStore']} and check the box Display section heading.
    Now when I save the dashboard I can see the value of the session variable. However, when I change the session variable with the prompt, thenb I can see that the report is changing, but the title isn't.
    Can anyone help me on this? My reference on this was: http://4.bp.blogspot.com/_f689sAiiG-E/SKv8Fxu7wNI/AAAAAAAAAPk/pppwQ1DdEhg/s1600-h/obi-ee-variables-overview.jpg
    I think it is a bug, but perhaps someone knows
    OBIEE version:
    Build: 10.1.3.4.1.090414.1900
    Release Version: Oracle Business Intelligence 10.1.3.4.1
    Package: 090414.1900

    Thanks for all your responds!!
    However, I was thinking in first instance on a narrative view myself indeed, however this is not good enough for me, because I really have an almost pixel perfect dashboard.
    But the thing with the prompt works!!! What I have done is making an extra prompt with the default value set to the session variable and then I set a presentation variable in the same prompt, and after that I am filtering the reports on the presentation variable in stead of the session variable.
    But I cannot find anywhere where to hide the prompt, can you tell me this?
    The only way I can hide things is to set permissions I gues, but then I also guess is that the prompt will do not do its tasks when the user has no permissions to this prompt.
    Hope you can help me out on this last part!!

  • Copy "Artist - Song name" to the clipboard

    The aim is to assign a shortcut for copying the artist and name of currently playing or selected song from iTunes to the clipboard.
    How it can be done?

    I usually recommend not manipulating the clipboard via AppleScript - not because it can't be done (it can), but because there are usually better options.
    In any case, since I don't know what you're ultimately trying to do...
    tell application "iTunes"
              if player state is playing then
                        set TA to artist of (get current track)
                        set TN to name of (get current track)
      set the clipboard to TA & " - " & TN
              end if
    end tell
    The issue is assigning this to a key shortcut, which AppleScript can't do on its own.

  • How do I load a picture from the clipboard (either Windows clipboard or Labview clipboard) into image data that can then be processed in Labview?

    I want to load a picture from the Windows clipboard (and if not possible, then from the Labview clipboard) into actual numerical image data so that it can be processed in lab view. When I'm at the main screen where I can add controls, I see a section of controls called "Vision" in the tool bar where all the different controls can can be added from. When I go to the control called "Image" and put that on my form, and then look at the flowchart/blockdiagram programing window to see what inputs and outputs it has, I only see one output, and no inputs. And when I right click on it, I see NO way to load an image into the Image control. PLEASE help me.
    Message Edited by Ben321 on 11-09-2008 04:32 PM

    Hi Ben,
    National Instruments has an image processing software called Vision and although I am not completely sure, I think the controls that you found in the control pallet are used in conjunction with the software. Depending on what kind of image processing you want to conduct in LabVIEW, you might want to consider purchasing that product.
    If cost is an issue, there are functions in LabVIEW which allows you to take in image files and process them. However, please keep in mind that the capabilities are limited.
    Images should be loaded onto LabVIEW not via the clipboard but through loading it from folders or directories. (There might be a way to and so if you find a way please let me know! I would like to know myself =D) If you open the function pallet by right clicking on the block diagram, in the programming folder you should find a directory called "Graphic and Sound". There, you'll find functions in which allows you to process images.
     In the "Graphic Type" directory there should be a function called Read JPEG file.vi. There are also others which allows you to read png and bmp files. Please note that there are functions which write as well. Set a file path on the block diagram and inside the "Grahic and Sound" there is a "Picture Function" directory and inside there, there should be a function called "Draw Flattened Pixmap.vi" That changes the image into a format where you can process on LabVIEW. Inside the "Picture Function" directory there are several functions which allows you to process the specified image. Play around with it and see how it goes. And don't forget to Write the file in the end to save any changes.
    I hope this helps
    National Instruments Japan
    Applications Engineer Taiki Hoshi

  • How to create, place, format and paste the clipboard contents into a text frame

    I am new to scripting and need help. I have an existing Indesign document. I need to be able to create a text frame on my current page, the width of my margins with the top of the text frame at the top margin and 1" in height, then format it to be 1-column, and then paste the clipboard contents into it and tag the text with a particular paragraph style. I am using Indesign CS4 on a mac, if that makes any difference. Thanks for any help.

    May this will help you. It will create an anchored object with a text what you desired, with object style. You should create an object style before with the x and y co ordinates. You can choose either para style or character style.
    var the_document = app.documents.item(0);
    // Create a list of paragraph styles
    var list_of_paragraph_styles = the_document.paragraphStyles.everyItem().name;
    // Create a list of character styles
    var list_of_character_styles = the_document.characterStyles.everyItem().name;
    // Create a list of object styles
    var list_of_object_styles = the_document.objectStyles.everyItem().name;
    // Make dialog box for selecting the styles
    var the_dialog = app.dialogs.add({name:"Create anchored text frames"});
    with(the_dialog.dialogColumns.add()){
    with(dialogRows.add()){
    staticTexts.add({staticLabel:"Make the anchored frames from ..."});
    with(dialogRows.add()){
    staticTexts.add({staticLabel:"This character style:"});
    var find_cstyle = dropdowns.add({stringList:list_of_character_styles, selectedIndex:0});
    with(dialogRows.add()){
    staticTexts.add({staticLabel:"Or this paragraph style:"});
    var find_pstyle = dropdowns.add({stringList:list_of_paragraph_styles, selectedIndex:0});
    with(dialogRows.add()){
    staticTexts.add({staticLabel:"Leave one dropdown unchanged!"});
    dialogRows.add();
    with(dialogRows.add()){
    staticTexts.add({staticLabel:"Delete matches?"});
    var delete_refs = dropdowns.add({stringList:["Yes","No"], selectedIndex:0});
    dialogRows.add();
    with(dialogRows.add()){
    staticTexts.add({staticLabel:"Anchored text frame settings:"});
    with(dialogRows.add()){
    staticTexts.add({staticLabel:"Object style:"});
    var anchor_style = dropdowns.add({stringList:list_of_object_styles, selectedIndex:0});
    with(dialogRows.add()){
    staticTexts.add({staticLabel:"Frame width:"});
    var anchor_width = measurementEditboxes.add({editUnits:MeasurementUnits.MILLIMETERS, editValue:72});
    with(dialogRows.add()){
    staticTexts.add({staticLabel:"Frame height:"});
    var anchor_height = measurementEditboxes.add({editUnits:MeasurementUnits.MILLIMETERS, editValue:72});
    the_dialog.show();
    // Define the selected styles
    var real_find_cstyle = the_document.characterStyles.item(find_cstyle.selectedIndex);
    var real_find_pstyle = the_document.paragraphStyles.item(find_pstyle.selectedIndex);
    var real_anchor_style = the_document.objectStyles.item(anchor_style.selectedIndex);
    // Check if a style is selected
    if(find_cstyle.selectedIndex != 0 || find_pstyle.selectedIndex != 0) {
    // Define whether to search for character styles or paragraph styles
    app.findChangeGrepOptions.includeFootnotes = false;
    app.findChangeGrepOptions.includeHiddenLayers = false;
    app.findChangeGrepOptions.includeLockedLayersForFind = false;
    app.findChangeGrepOptions.includeLockedStoriesForFind = false;
    app.findChangeGrepOptions.includeMasterPages = false;
    if(find_cstyle.selectedIndex != 0) {
    app.findGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences.appliedCharacterStyle = real_find_cstyle;
    } else {
    app.findGrepPreferences = NothingEnum.nothing;
    app.findGrepPreferences.appliedParagraphStyle = real_find_pstyle;
    app.findGrepPreferences.findWhat = "^";
    // Search the document
    var found_items = the_document.findGrep();
    myCounter = found_items.length-1;
    do {
    // Select and copy the found text
    var current_item = found_items[myCounter];
    if(find_pstyle.selectedIndex != 0) {
    var found_text = current_item.paragraphs.firstItem();
    var insertion_character = (found_text.characters.lastItem().index) + 1;
    var check_insertion_character = insertion_character + 1;
    var alt_insertion_character = (found_text.characters.firstItem().index) - 1;
    var the_story = found_text.parentStory;
    app.selection = found_text;
    if(delete_refs.selectedIndex == 0) {
    app.cut();
    } else {
    app.copy();
    } else {
    var found_text = current_item;
    var insertion_character = (found_text.characters.lastItem().index) + 2;
    var check_insertion_character = insertion_character;
    var alt_insertion_character = (found_text.characters.firstItem().index) - 1;
    var the_story = found_text.parentStory;
    app.selection = found_text;
    if(delete_refs.selectedIndex == 0) {
    app.cut();
    } else {
    app.copy();
    // Make text frame from selection
    try {
    app.selection = the_story.insertionPoints[check_insertion_character];
    app.selection = the_story.insertionPoints[insertion_character];
    } catch(err) {
    app.selection = the_story.insertionPoints[alt_insertion_character];
    var the_anchored_frame = app.selection[0].textFrames.add({geometricBounds:["0","0",anchor_height.editContents,anch or_width.editContents],anchoredObjectSettings:{anchoredPosition: AnchorPosition.ANCHORED}});
    app.selection = the_anchored_frame.insertionPoints[0];
    app.paste();
    // Apply the object style now to "force apply" paragraph style set in the object style
    if(anchor_style.selectedIndex != 0) {
    the_anchored_frame.appliedObjectStyle = real_anchor_style;
    myCounter--;
    } while (myCounter >= 0);
    } else {
    alert("No styles selected!");

  • How to create a presentation variable outside the prompt in OBIEE 10.1.3.4?

    I am having a situation as below:
    I have a "Month" and "Year" dashboard Prompt.
    Once the user selects a particular Month and year, that particular month's end date should be defined as a presentation variable. (For example, if the user selects 'September' and 2011 then '30-sep-2011' should be the presentation variable).
    I dont want the Month End Date to be a part of the prompt.
    Please suggest.

    Hi
    if you have access to metalink, there is a patch..released by oracle.
    i had this same issue and solved it by applying the patch.
    instructions are given in that patch release on how to apply that.
    just replace the DAWServer.jar file in DAC/ Folder by taking a backup of exisitng one
    thank you
    kumr

  • How to set a bind variable across the pages in a report

    I want to create a portal report where data will come from a table for a date range for a week.
    For e.g select event_date,last_name, event_name
    from RESOURCES
    where event_date between trunc(to_date(:curr_date,'DD-MON-RRRR'))
    and trunc(to_date(:curr_date,'DD-MON-RRRR')+ 7)
    The :curr_date is defined as a bind variable whose default value is sysdate.
    Now, when we run the report for the first time, it takes the :curr_date as
    sysdate and prints the report.
    I have two buttons in the report output like "previous week" and "next week".
    If someone presses previous week, the same report should run with curr_date
    as sysdate-7 and if someone presses next week, the report should run with
    curr_date as sysdate +7 and also the :curr_date sets to sysdate - 7 or sysdate + 7
    depending on the button pressed.
    Problem:
    How do I set the value of curr_date if someone presses any of
    previous week/next week.
    null

    Best to state your JDev version, and technology stack (eg. ADF BC) when posting.
    I can think of 2 approaches.
    1) Create a parent VO based on SELECT :bindVar FROM dual, then create links between your other VOs and the parent
    2) Create a AM client interface method that programatically sets the bind variable in each VO.
    Can you specify your use case? This one tends to come up when discussing effective from/to dated queries.
    CM.

  • How to reference a static variable before the static initializer runs

    I'm anything but new to Java. Nevertheless, one discovers something new ever' once n a while. (At least I think so; correct me if I'm wrong in this.)
    I've long thought it impossible to reference a static variable on a class without the class' static initializer running first. But I seem to have discovered a way:
    public class Foo  {
      public static final SumClass fooVar;  // by default initialized to null
      static  {
         fooVar = new SumClass();
    public class Bar  {
      public static final SumClass barVar;
      static  {
         barVar = Foo.fooVar;  // <<<--- set to null !
    }Warning: Speculation ahead.
    Normally the initial reference to Foo would cause Foo's class object to instantiate, initializing Foo's static variables, then running static{}. But apparently a static initializer cannot be triggered from within another static initializer. Can anyone confirm?
    How to fix/avoid: Obviously, one could avoid use of the static initializer. The illustration doesn't call for it.
    public class Foo  {
      public static final SumClass fooVar = new SumClass();  // either this ..
    public class Bar  {
      public static final SumClass barVar = Foo.fooVar;  // .. or this would prevent the problem
    }But there are times when you need to use it.
    So what's an elegant way to avoid the problem?

    DMF. wrote:
    jschell wrote:
    But there are times when you need to use it. I seriously doubt that.
    I would suppose that if one did "need" to use it it would only be once in ones entire professional career.Try an initializer that requires several statements. Josh Bloch illustrates one in an early chapter of Effective Java, IIRC.
    Another classic usage is for Singletons. You can make one look like a Monostate and avoid the annoying instance() invocation. Sure, it's not the only way, but it's a good one.
    What? You only encounter those once in a career? We must have very different careers. ;)
    So what's an elegant way to avoid the problem? Redesign. Not because it is elegant but rather to correct the error in the design.<pff> You have no idea what my design looks like; I just drew you a couple of stick figures.If it's dependent on such things as when a static initializer runs, it's poor. That's avoidable. Mentioning a case where such a dependency is used, that's irrelevant. It can be avoided. I know this is the point where you come up with a series of unfortunate coincidences that somehow dictate that you must use such a thing, but the very fact that you're pondering the problem with the design is a design problem. By definition.
    Besides, since what I was supposing to be a problem wasn't a problem, your "solution" isn't a solution. Is it?Well, you did ask the exact question "So what's an elegant way to avoid the problem?". If you didn't want it answered, you should have said so. I'm wondering if there could be any answer to that question that wouldn't cause you to respond in such a snippy manner. Your design is supposedly problematic, as evidenced by your question. I fail to see why the answer "re-design" is unacceptable. Maybe "change the way the Java runtime initializes classes" would have been better?
    This thread is bizarre. Why ask a question to which the only sane answer, you have already ruled out?

Maybe you are looking for

  • IPod as Hard Drive

    Hi, I used to be able to drag and drop files for storage onto my iPod, after it appears on my desktop as a device but my new iPod touch no longer appears on my desktop as a device, so i can't access this functionality. Is there a way of changing this

  • Change name of the TAB

    Hi Gurus, I am working in CRM 4.0 Channel Management. I want to change only the name of the TAB, e.g. in the application Opportunity CRMD_ BUS2000111 the TAB name Attachments - field Group OPP_DOCUMENTS and event OPP_HD_DOCUMENTS. We only want to cha

  • How to open current version.fcpproject in final cut pro x?

    I had a final cut project set up and ready to edit, but when i tried to open the file from finder it would say it was trying to open the file and then the rotating color disk appears until fcp is forced to quit.  please tell me there is an easy solut

  • How do I edit a newly created pdf file? (RE matching a format for a create space output)

    I need help with editing and formatting a newly created pdf file

  • OFFLINE BACKUP finished with error

    Dear all, please find the below Offline backup log BKI0400I: TDP is waiting for BRBACKUP. BR0280I BRCONNECT time stamp: 2010-03-05 22.05.33 #BEGIN /oracle/IRP/sapdata3/undo_1/undo.data1 BR0280I BRCONNECT time stamp: 2010-03-05 22.05.33 BR0345E Error