How to use built-in OS commands

In adobe Air applications, by default, we have an Application
menu (in Mac) and a Windows menu (in windows), featuring File and
Edit menus. Under the Edit menu, there are standard commands (Cut,
Copy, Paste, Select All) etc.
Is there any way, I can programmatically call a menu command
(Say "Copy"). That is, say by clicking on a button? I have tried
NativeApplication.nativeApplication.Copy() and such, but these are
not reliable, especially out of the application sandbox. I was able
to refer the menuItem "Copy" as
NativeApplication.nativeApplication.menu.getItemAt(2).submenu.getItemAt(1).label
which was correctly traced as "Copy" menuItem of native menu
in
adl, and similarly in my own air app as well (on my mac
machine), however, I don't know how to invoke that method by a
button click.
I have also tried to dispetch the select event by
NativeApplication.nativeApplication.menu.getItemAt(2).submenu.getItemAt(1).dispatchEvent(n ew
Event(Event.SELECT));
and
NativeApplication.nativeApplication.menu.getItemAt(2).submenu.getItemAt(1).dispatchEvent(n ew
MenuEvent(MenuEvent.SELECT));
which both are traced "true", however, nothing is copied to
clipboard (which is suppossed to be selected text in a text area).
Any help on this? My exact requirement is to mimic/generate
the application menu click event ("Copy"), which is the only thing
that works perfectly when done using mouse click on the actual
menu. I just want to do it programmatically, by calling the same
copy function on a button click.
thanks in advance...
Mits

Thank you peers for your feedback. I appreciate it verymuch.
@ Reider: Yes, I considered this, and hence I tried to call
the NativeApplication.nativeApplication.Copy() on MouseEvents such
as click, mouseup, mousedown etc. of the embedded pdfobject itself,
so that it doesn't loose focuse. It didn't work either. I also
tried preventDefault() in combination with pdfObject.getFocus()
methods (that is to say, restore focus back to the pdf object),
which didn't work either. I will try the other focus events
suggested by you.
@ Joe ... Ward: I agree, but here is the situation. I am not
able to provide any reference to selected text (which is in a adobe
reader plugin, not the application sandbox.). So I can not put the
selected text on the clipboard without telling (referencing) the
clipboard what to put in it. I am not able to copy the text by
NativeApplication.nativeApplication.Copy() method, and as far as I
beleive, it is not the focus problem. However, when I select the
text in the pdf object (wrapped in a htmlloader control) and select
"copy" from the application menu "Edit" in adl and my air app both,
I can get the text copied to the clipboard. So I think the
application menu command copy is different then
NativeApplication.nativeApplication.Copy(). Correct me if I am
wrong. Any other ideas? Or am I doing something wrong?
Thanks again for your feedback.
Mits

Similar Messages

  • How to use built in microphone on ipad3 I have Siri on but no icon shows on my keyboard just want to record voice

    How to use built in microphone on ipad3 just for audio no dictation

    If you just want to record a a voice memo, use the included Voice Memos app. That has nothing to do with Siri.

  • How to use built in dictionary in Mac OS X lion on PDF file?

    Hi there,
    Does anyone know how to use built in dictionary in Mac OS X lion on PDF file with out using trackpad? Thank you.

    I don't know what to tell you, it works perfectly for me...
    My expertise ends here... Hopefully someone else comes along with useful suggestions and tips.

  • How to use built-in webcam for Skype?

    How does one use the built-in webcam online? My iMac's webcam can be accessed through Photo Booth, but only, it appears, to take photos or brief movies. I've searched this forum, but don't find how one can use the webcam online such as in Skype. A program called iSight is mentioned in several posts, but my year-old iMac doesn't have that program. Any clues on how to use the camera beyond Photo Booth? Many thanks.

    HI Bob,
    You can use Skype with your iMac and iSight.
    Go here, download Skype
    The Skype application will be installed to your Applications folder. Launch Skype. You will need to create a username and password. Once you have logged into Skype from the Menu Bar at the top of your screen click Skype/Preferences and selec the Video tab. Click the pop up menu where you see: Camera and select: Built-in iSight
    More about using Skype here.
    https://support.skype.com/
    Carolyn

  • Solaris 8: how to use the adb execution commands in mdb?

    Hi,
    I want to execute some adb commands like the :c, :b, etc, in mdb, but the mdb always prompt:"mdb: invalid command ':c': unknown dcmd name". So how can I use those commands?
    Thanks.

    Yes, I am using the mdb on my application. I start mdb and attach one process, and I use the 0xnnnnn:b, the mdb's output :
    mdb: invalid command ':b': unknown dcmd name.
    The mdb document describe that the mdb support adb's commands, but the mdb's command ::dcmds does not list some adb's commands like the :b, :c. so Why ? And how to use these commands?
    Thanks.

  • How to use -open option at command prompt

    Can someone update me with how to use -open option while launching javaws from command prompt. Sun documnetation (http://java.sun.com/javase/6/docs/technotes/tools/share/javaws.html#runoptions) is not very clear.
    I am trying to do something like this
    javaws -open prop1 firstName prop2 lastName http://myapp.jnlp
    However the above does not work. It says incorrect argument firstName.
    Cheers
    Amit

    The syntax as present in JWS documentation
    javaws [run-options] <jnlp>
    [run-options] Command-line run-options. run-options may be in any order. For a discussion of the various run-options, see RUN-OPTIONS below.
    <jnlp> This can be either the path of, or the Uniform Resource Locater (URL) of the JNLP (Java Network Launching Protocol) file.

  • [Forum FAQ]How to use Azure Cross-Platform Command-Line interface in Mac OS

    1. Download the installer on Microsoft Azure website.
    Figure 1.
    2. Open the DMG file and install the following package.
    Figure 2.
    3. Open Terminal (Mac OS build-in), type “azure login” and enter your azure account to login.
    (Note: you can login only via a Microsoft organizational account or service principal.) We used a Microsoft account to connect. (Figure 3)
    Figure 3.
    After that, we can use the commands to manager Azure instances and services. You can type “azure help” to list all the available commands.
    Figure 4.
    If you want to view the detailed information for a specific command, you can type “azure help xxx”. For example, we can run “azure
    help vm” to list all the commands for managing Azure Virtual Machines.
    Figure 5.
    In the figure below, we used the “vm create” command to create a new virtual Machine (testmachine002) in a new cloud service (testmachine003)
    and virtual network (vnet1).
    Figure 6.
    To obtain the image name, you can type “azure vm image list”:
    Figure 7.
    After the “vm create” command executed, we can find that the Virtual Machine(testmachine002) is created in Azure management portal.
    Figure 8.
    More information:
    http://azure.microsoft.com/en-us/documentation/articles/xplat-cli/
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Here on Apple Discussions, you will find many command line enthusiasts hanging out in the UNIX forum. Good luck.

  • How to use new cluster  'cl' commands from c/c++ code

    Hi All
    I need to invoke cluster commands from c/c++ code and parse the output to retrieve neccessary fields e.g status to be used in program.
    e.g
    #cluster status
    I need to capture output and use it in c/c++ code.
    Does any one have tried to use new cluster 'cl' commands from c/c++ code??
    Thanks
    Pandit

    The output of the cl* commands is for human consumption and as such (as most administrative commands) the output is not considered stable, so it could change with a Patch, etc.
    Instead you should use the cluster api to retreive the information you need.
    The Sun Cluster Data Services Developer's Guide for Solaris OS (http://docs.sun.com/app/docs/doc/819-2972?a=expand) describes the various possibilities, including the C API.
    Read especially http://docs.sun.com/app/docs/doc/819-2972/6n57ngitf?a=view for more details as which functions are available via the libdsdev. Each function has a specific manpage outlining the lib and includes needed as well es which information it offers.
    In your example, you can use scha_resource_get() (3HA) in order to retrieve the status of a specific resource (http://docs.sun.com/app/docs/doc/819-3055/6n5a6lhnl?a=view).
    Greets
    Thorsten

  • How to use both At USER-COMMAND and AT LINE-SELECTION in one abap program

    I am trying out a program where I need to use both line selection and user command events in one program. Suggest me how to do it.

    USE the okcode 'PICK'. (I mean add a 'PICK' in the GUI staus or the menu.) When ever u use both the events u have to use PICK to trigger the at line selection.
    U just need to add the PICK in the GUI status and ofcourse write code in the program.
    AT LINE-SELECTION.
    CASE sy-ucomm.
    WHEN 'PICK'.
    write:/ 'HELLO WORLD'.
    ENDCASE.

  • How to use built-in camera to take self picture to use on Facebook

    A friend of mine is willing to set me up on Facebook but he wants a picture of me.
    Can I use the built-in camera on my MacPro to take such  a pic and send it to him?
    How does this work, please?
    Thanks so much
    Carole

    Use Photo Booth.   
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 
    Got problems with your Apple iDevice-like iPhone, iPad or iPod touch? Try Troubleshooting 101

  • How to use built-in iSight & external Firewire iSight simultaneously?

    The solutions I've found here and elsewhere, about launching iChat first so it "controls" the internal iSight and will force the firewire iSight to work, does not work. With Quicktime and Photo Booth, I stll get the feed from the internal camera.
    iChat has a dropdown menu showing "Built-in iSight" and "iSight". But when "iSight" is selected, the message "Camera is off" appears.
    What is the definitive method for using the built-in iSight and the firewire iSight simultaneously?  Thank you.

    Hi,
    Several answer to the implied questions.
    By Default iChat will choose the camera listed in the iChat menu > Preferences > Video section > camera drop down.
    (If there is only one camera this drop down does not appear)
    The External iSight may need it's iris opened if it is plugged in but you are being told it is Off.
    However also you may benefit from ticking the check box about an External Camera at the bottom of the same pane.
    As for "Simultaneously" http://b-l-a-c-k-o-p.com/CamCamX.html
    Other VJ type apps or that will do VJ type stuff are listed here under Movie Capture.
    10:18 PM      Saturday; June 25, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.7)
     Mac OS X (10.6.7),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • How to use Labview to Send Commands to Excel on Analyzing Data

    Hello, here is my situation:
    I have a Labview VI that reads in data from various sensors and uses the Report Generation Toolkit to send all the data values to Excel. Since every run is ~ 8-10 hrs long and there's tons of data, I don't bother to store them all in an array in my VI. 
    However, within my Excel report I'd like to include a few stats, such as initial, final, max, and min values from all those data points. What kind of command should I send from my VI to get Excel to do this? Or would it be easier to do this within Labview instead?
    Thanks to anyone who can give some advice!
    Solved!
    Go to Solution.

    Hello, Kalyie!
    puneet.kapoor is indeed correct, you can create an Excel macro and call it from LabVIEW. An example of this can be found in LabVIEW under Help>>Find Examples. By searching for "Excel," you'll find "Excel Macro Example." This would be more useful for automating your functions, or if you're trying to do more complex operations on your data in Excel (min and max are relativelty simple, though).
    As also mentioned, it may be easiest to work with your data once it's in excel, using the "=Max( )" and "=Min( )" functions - the choice is yours!
    Will Hilzinger | Switch Product Support Engineer | National Instruments

  • Please let me know how to use ++HLN text CVR command in sapscript

    Hi,
       does any one know how this ++HLN number CVR command need to implement in sapscript?
    Regards,
    Challa.

    Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card

  • How to use Runtime execute DOS command?

    Hello,
    I can not use Runtime class execuste Dos command such as copy and dir.
    Is there any suggestion?
    Thanks in advance.

    execute the command with cmd /c (winNT, win2k) or command /c (win9x). Example: "cmd /c dir"
    details: http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • How to use wait.for() /wait() commands for MAC? Not working...

    I am trying to run an external application on mac using runtime.exec() and it runs fine but after it runs it suddenly terminates the program. I have a waitFor() command after the runtime.exec() waiting for that program to end. If i comment out the waitFor() then the program terminates by going through the run command. The waitFor() worked fine for PC but doesnt work for MAC... anyone know what i did wrong or alternative way of listening for it? thanks!

    On the PC i have the following:
    Process p = Runtime.getRuntime().exec("C:\\program Files\\QuickTime\\QuickTimePlayer.exe "
    +file.getPath());
    p.waitFor();
    It basically creates a process of QuicktimePlayer and runs the file specified. I then have p.waitFor() used to wait for the user to close the application so i can do listener stuff for it- it worked for PC.
    On Mac
    String b= "open"+ tempFile.getPath();
    Process p= Runtime.getRuntime().exec(b);
    System.out.println("before wait");
    p.waitFor(); .
    System.out.println("app. terminated");
    output:*
    "before wait".
    Program terminates before System.out.println("app. terminated"); but the application (quicktime) starts.
    if I do this:
    String b= "open"+ tempFile.getPath();
    Process p= Runtime.getRuntime().exec(b);
    System.out.println("before wait");
    // p.waitFor(); .
    System.out.println("app. terminated");
    output:*
    before wait
    app.terminated
    program terminates "normally" and I see "app.terminated".
    I used Eclipse so the "red square" turns red when running it and suddenly grays out when the player appears. So to me the program terminated before the p.waitFor(); If i commented out p.waitFor() then the program goes to the System.out statement and everything goes "fine". I tried using thread.wait(), this.wait() p.wait() etc. but i get errors saying they are not owner of the thread.
    hope this helps. thanks

Maybe you are looking for