Trigger an event with key command?

In InDesign CS3_Scripting Guide quote "The following table lists events to which eventListeners can respond. These events can be triggered by any available means, including menu selections, keyboard shortcuts, or script actions." I currently have a script that activates a UI when the user presses save. I am interested in changing that action to happen when a user presses a key.
I do not see any documentation on this. The UI popping up on save all the time is kind of annoying. I was thinking maybe option or command H or anything really.
listen();
function listen(){
var mySampleScriptMenu = app.menuActions.item("$ID/kSave");
var myEventListener = mySampleScriptMenu.eventListeners.add("beforeInvoke", myFunction, false);
I am using CS5 mac.

I found this in the Script UI 1-9 PDF.
Listening to the keyboard
To listen to the keyboard, define an event listener using the keyboard event
keydown. Here is an example that prints some properties of the keyboard event
(this doesn't work properly when you target the ESTK):
var w = new Window ("dialog");
var edit = w.add ("edittext");
edit.active = true;
edit.characters = 30;
w.addEventListener ("keydown", function (kd) {pressed (kd)});
function pressed (k)
$.writeln (k.keyName);
$.writeln (k.keyIdentifier);
$.writeln (k.shiftKey ? "Shift pressed" : "Shift not pressed");
$.writeln (k.altKey ? "Alt pressed" : "Alt not pressed");
$.writeln (k.ctrlKey ? "Ctrl pressed" : "Ctrl not pressed");
w.show ();
I think this is something I might try. I am currently using key board shortcuts in Indesign now but if I write this into the code I will not have to set up on each machine and each version of indd. I am currently using option T to get my script going.
Can you tell me what the d stands for in this function?

Similar Messages

  • Acrobat won't open pdfs on clicking file icon and won't quit with key command

    Acrobat won't open pdfs on clicking the file icon and won't quit with key command.

    IF you command I on any .pdf file, what does open with show?
    Restore the Acrobat preferences files (Mac OS)
    Restore the Acrobat preferences files to eliminate problems caused by a damaged preferences file.
    Note: Re-creating the Acrobat preferences files restores settings to their defaults. 
    Quit Acrobat.
    Drag the following files from the Users/[Username]/Library/Preferences folder to the Desktop:
    Acrobat WebCapture Cookies
    com.adobe.Acrobat.Pro.plist or com.adobe.Acrobat.Pro_x86_9.0.plist
    Acrobat Distiller Prefs and com.adobe.Acrobat.Pro.plist (if you are troubleshooting an issue with Distiller)
    The Acrobat folder, which contains preferences for forms (MRUFormsList), collaboration (OfflineDocs), and color settings (AcrobatColor Settings.csf)
    Restart Acrobat

  • Trigger Animate Audio Event with Key Position

    So I've got a long scrolling site that is supposed to trigger an audio event at a certain position.
    Right now I've got an edge animate file in there that is set to trigger at a specific key distance, which it sort of does.
    The issue is that the audio is triggered when I first load the page and then will trigger again only if I'm scrolling upwards.
    The animate file has a couple alterations. The scene has an oncompletion event that says to pause the whole piece and autoplay is turned off.
    I'm using Win 7 and Chrome if that makes any difference.
    Any suggestions?
    If there is a more elegant solution I'm open to that as well. This just seemed to make sense with my current workflow.
    Thanks all!

    You would need to achieve this using JavaScript , add a snippet on event so that on complete load video file is played :
    http://stackoverflow.com/questions/12680432/whats-the-play-event-on-a-video-html5-element
    Thanks,
    Sanjit

  • Close one tab at a time with key commands

    Hi all,
    I'm a big key command guy. I think I've figured out most things so I rarely have to go for the trackball and leave the keyboard.
    But recently (I think since an upgrade to Safari, but I can't be 100% sure), my previous command-W that used to close the frontmost tab now closes the entire window...bummed! How do I get my key command back?
    Thanks all.

    Start with resetting all shortcuts to their defaults, restarting, and see if that fixes the problem. As I said, it works here w/o any changes made, so I suspect you or some other app mucked things up.

  • Cut and paste with key command?

    hi, I've looked at the remote desktop help, and it does seem possible to cut and paste using the "Get the remote clipboard contents" button.... but is there a way to do this with a key command? Shouldn't this be possible with just the keyboard?
    thanks

    No. Just use Pages '09 if you still have it.
    Pages 5 is just missing a lot of features.
    Peter

  • Sizing text with key commands

    I recall seeing a co-worker use a sequence of key commands to resize text, but I can't recall what they were. Rather than highlighting text and going through a series of adjustments at regular increments until the text looked about right, the writer used this combination of keys to resize text in one step. I don't think she used free transform. Whatever she did, it was a great timesaver. Anyone have info on how to do this?

    On Windows:
    1. (You're typing away, then when you want to resize some text) do:
    2. Select the text you want to resize: Ctrl+A: all text in the current story; Esc: current text frame only; Shift+Ctrl+arrows: some characters. words, paragraphs. When you're through selecting,
    3. Once or twice Ctrl+T (you should see the Character panel with the typeface name selected), now two taps on the Tab key. You're now in the point-size field, to resize,
    4. Up/down arrows to set a different type size (Shift+up/down arrow to resize in bigger increments).
    5. Press Enter to return the cursor to the text.
    When you've done this once, you can go to the font-size field in one go by pressing Ctrl+` (Ctrl+` returns you to whichever entry field you were last).
    Peter

  • ITunes 10.4.1 Problem with Key Command Go to Current Song - Doesn't always work

    Since updating to iTunes 10.4.1, I've noticed that the key command, command + L doesn't always work to display the current song.

    I have this problem in iTunes 10.7 (21). The "Go to Current Song" option exists in the Controls menu, but even when audio is playing it is disabled.

  • Scaling with key commands not working with objects or text frames

    Suddenly, I can no longer hold Shift+Option+Command to proportionally scale anything in InDesign CC 2014. Any suggestions?

    Which file do I want to trash or rename?

  • Advice needed on Key Commands presets in Logic

    Hi, just upgraded to Snow Leopard and Logic 9 and very happy. Now I'm planning to work more with key commands. While watching many Logic 9 tutorial video's on youtube etc. I find different Logic users seem to work with different (default) key commands. For example: on http://www.youtube.com/user/groove3Inc#p/search/2/BSE3VdlkZJM he's using Ctrl * for 'Capture as recording', while for me the default command is Ctrl Alt Cmd R
    Now my question is:
    1. What is the default / standard key command preset in Logic
    2. Which Key Command preset in Logic would be best to use (also considering that on a different location I sometimes work with Protools)
    3. Which Key Command preset in Logic would be best to use considering the many tutorials I find on the web
    Or any other advice / tips on key commands...
    Thanks!

    You can easily create your own set of key commands, according to your own needs. I mean, you still can learn some built-in key commands, but you can also change them as you please. Probably, in your case it might make sense to have the same set of key commands for both Logic and Pro Tools, to make life easier.

  • LPX Key Commands acting weird???

    I have 2 problems with Key Commands window.
    1.-I have opened the KeyCommands window and it opens up at the top of my screen.
    The top of the Key Commands window is under the task bar and I can not pull it down.
    2.- My LPX Key Commands started to act weird.
    Space bar does not work for play/pause.
    It creates a small MIDI region instead.
    X does not show the mixer and any other thing does not really work.
    It worked at the beginning when I firs installed it.
    Could this be a bug?
    If I choose Logic 9 set the everything works like the LP9 and it is fine.
    But, I wanted to learn the new set and I cannot use it.
    Any ideas?

    hi
    Do you have installed another language for typing?
    If so check that your keyboard is in US typing
    Logic respond strange when another language is active
    hope it helps
    B

  • Iphoto events showing with key photo of a palm tree in gray?

    iphoto events showing with key photo of a palm tree in gray? Also indicates no photos but there are photos within the event??

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In early versions of Library Manager it's the File -> Rebuild command. In later versions it's under the Library menu.)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  
    Regards
    TD

  • Key Command troubles: Set Region/Event Start to SPL Position not working?

    Hello,
    I'm simply trying to find a key command that will allow me to move regions quickly from one part of a song to another without dragging with them with the mouse in the arrange window. I thought I found the solution with the key command "Set Region/Event Start to SPL Position", however it doesn't seem to be doing anything!
    Here's what I've tried: First I select the region I want to move, then I move my SPL to a location using the "go to Position" key command and typing in a bar. I then try to use the "Set Region/Event Start to SPL Position" key command (which I set to Shift-Control-L) and nothing happens. Shouldn't it be moving my region to the SPL? Note: the region is still selected, but refuses to move. Am I doing something wrong? Is this not what this key command was designed to do?
    In my attempts to get the darn thing to work, I also discovered that lock screen-set (Shift-L) key command also does not seem to work (it is not toggling the black dot after the screen-set number like usual). Does this mean my key commands may be corrupted? (which would be a real drag!!) Oddly enough, these are the two are the only two that do not seem to be working, as all others seem to be working fine (AFAIK).
    I've had this problem in the past with the lock screen-set key command not working, and rebuild all key commands and templates when I upgraded to tiger. I thought everything was working fine!
    Any advice would be greatly appreciated! Thanks in advance for your help!!

    I assigned F5 to two functions. In the key commands
    window, pressing F5 highlighted the first assignment.
    Pressing it again highlighted the second assignment.
    So just keep pressing the key to see whether it's
    assigned to more than one command...
    Well, now when I type "Shift-L" into the finder in the top right of the key commands window, no key commands at all are show. However, which I search for the word "lock," the lock screenset key command comes up as "Shift-L." Oddly, if I search any other key commands (such as F1, "cmd-k," or even other shift ones like "shift-," the associated key commands show up.
    To test, I changed the screen set lock from Shift-L to "opt-ctrl-L" and it now works again. However, it still will not come up in the key commands window through searching by "opt-ctrl-L"
    On what may be a side note, the search feature seems very buggy! Tell me if I'm doing this right: First I open the key commands window, which opens with nothing selected. Now, in order to search by key command I go up to the top right corner where the magnifying glass is, place my curser inside and type in the key command correct? When I do this, it shows me the highlighted key command in the left, and my curser is no longer flashing up in the magnifying glass, correct?
    Now, in order to search again, I have to place my curser in the search field again, right? However, now when I search by key command, not all of them register! For example, my "go to position" key command is simply ; but when I type it, nothing comes up in the search, and instead of the magnifying glass window being blank like before, the actual ; is in the box. Oddly enough, searching with "Cmnd-K" still works!
    What is going on? Am I doing something wrong? How do I fix this, as it is very frustrating!! thanks again for your help

  • The problem I have since I upgraded to Mavericks version 10.9.1 The problem appears only with Mail not with other programs, not even with my browser. When I try to zoom the text of an e-mail I received or sent , I can no longer use the keys Command   to e

    the problem I have since I upgraded to Mavericks version 10.9.1
    The problem appears only with Mail not with other programs, not even with my browser.
    When I try to zoom the text of an e-mail I received or sent , I can no longer use the keys Command + to enlarge the text, although I can reduce it with Command -.
    As I have a problem with my eyes, This is a serious matter for me.
    When I write an e-mail, if I select text and press Command +, it just displaces the text to the right.
    Now, my husband has a USB keyboard. If he connects it to my computer, his regular Command + does not work either, but  he uses the extended keyboard, then it works. Unfortunately, he needs it for a musical application which does not work with a wireless keyboard.

    Firefox 3.6.4 and 3.6.6 use a process called, "plugin-container.exe" which was using up most of my CPU when I opened up multiple tabs that contained Adobe Flash files, and caused Firefox to lock up.
    My solution was to use Firefox 3.5.10 which you can get from the Mozilla website at [http://www.mozilla.com/en-US/firefox/all-older.html]
    I am using Adobe Flash 10.1.53.64 without any problem in this version of Firefox. Check the release notes, I believe it contains all the latest security fixes in "Firefox 3.6.4".
    Hopefully, they will fix Firefox 3.6 in the next version (e.g. Firefox 3.6.7), until then you should probably use "Firefox 3.5.10".

  • PUT KEY command with returned SW 6982

    There would be some other threads dealing with PUT KEY command however, my put key command failed with SW6982.
    Firstly, I have done it successfully in Java and now I migrate this solution to C#.Net, I have an PCSC class which helps me communicate with the SCreader. I refered to this thread
    [PUT KEY APDU|https://forums.oracle.com/forums/thread.jspa?threadID=1551395]
    I implement exactly the same as I have done in Java (based on source code provided in the thread mentioned above) but failed. Here's a log file for the communication
    Card Manager Selection --> Success!
    INITIALIZE UPDATE Command sent --> Success
    Data from Card: 00 00 00 93 02 90 97 95 20 93 01 02 00 0A FB 59 58 D6 62 71 BE 71 F2 E6 1C 37 D8 7D
    Diversification data: 00 00 00 93 02 90 97 95 20 93
    Static key set Calculation --> Success
    S-ENC: 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
    S-MAC: 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
    S-DEK: 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
    Session key set Calculation --> Success
    Session ENC: 33 9F 1D 7F 5D 58 41 EB 03 4F 5C E2 34 55 78 94
    Session C-MAC: C6 71 3F 31 B8 DC 1F 89 05 DF EC B4 06 5C B8 1E
    Session R-MAC: 3C AE E5 A2 73 1A D0 52 69 0B C8 B5 A1 0F 34 01
    Session DEK: 33 9F 1D 7F 5D 58 41 EB 03 4F 5C E2 34 55 78 94
    Card cryptogram: BE 71 F2 E6 1C 37 D8 7D
    Host cryptogram: 4B 48 C8 62 AB E4 E5 8C
    EXTERNAL AUTHENTICATE C-MAC: CB 83 EE 48 91 BE 1D 0C
    EXTERNAL AUTHENTICATE command: 84 82 00 00 10 4B 48 C8 62 AB E4 E5 8C CB 83 EE 48 91 BE 1D 0C
    Data to calculate MAC: 84 D8 01 81 4B 01 80 10 5C 8F 22 35 FF 24 F6 4E 20 92 4D BC 24 44 34 F7 03 8B AF 47 80 10 5C 8F 22 35 FF 24 F6 4E 20 92 4D BC 24 44 34 F7 03 8B AF 47 80 10 5C 8F 22 35 FF 24 F6 4E 20 92 4D BC 24 44 34 F7 03 8B AF 47
    PUT KEY apdu C-MAC: C7 16 78 CE F3 48 EE A7
    PUT KEY sent: 84 D8 01 81 4B 01 80 10 5C 8F 22 35 FF 24 F6 4E 20 92 4D BC 24 44 34 F7 03 8B AF 47 80 10 5C 8F 22 35 FF 24 F6 4E 20 92 4D BC 24 44 34 F7 03 8B AF 47 80 10 5C 8F 22 35 FF 24 F6 4E 20 92 4D BC 24 44 34 F7 03 8B AF 47 C7 16 78 CE F3 48 EE A7What I try to do is that: I try to replace the old key set (40...4F) by itself (no derivation rule is applied)
    I have replaced the values of this scripts to the java code and it produces the same values as in C# code. I really don't know why? The External Authenticate command executed successfully and I use its C-MAC to calculate to C-MAC of PUT KEY command (as detailed in EMV CPS v1.1, page 79/103).
    One more thing: in the source in the thread mentioned above, I saw that in the PUT KEY apdu command, he added the value "00" after the C-MAC of PUT KEY. I don't know why?
    Is there anybody experienced the same problem as mine and has resolved it? It would be very kind of you to spend a little time on my problem and advice me what to do, I'm really stuck now.
    Best regards,
    JDL

    bug found, question answer

  • I accidently deleted my url box at the top of safari. I believe I did this with the command key. Can anyone help me get it back? Thank you in advance!

    I accidently deleted my url box at the top of safari. I believe I did this with the command key. Can anyone help me get it back? Thank you in advance!

    Right click (cntl-click) on the top of the bar and select "customize toolbar".  Drag the default set back in.
    Regards,
    Captfred

Maybe you are looking for

  • Profit Center Accounting Extraction

    Hi guys,    I need to extract <b>Account Group</b> in my SAP R/3 to SAP BW <b>Profit Center Accounting > Account Group</b>     Please advice if I can use any of the Standard Extractors to extract the Account Groups to SAP BW ?     Your advice is very

  • Pixel Bender only available for jpg files?

    I'm running Photoshop CS5 on a brand new macbook. Everything has been working fine. I recently installed Pixel Bender and started playing with it. It seems to work fine on .jpg files, but whenever I open any PSD files, (or raw files from my Nikon) th

  • [solved] Pepper flash out of date?

    Just reinstalled the system (64bit), downloaded the latest chrome and extracted pepper flash to chromium. It always worked flawlessly but this time it's saying that the plugin is outdated and can't be used. This is just an annoyance since we can set

  • Will I obtain all protions and extra programs when I downloads Photoshop CS3 Extended

    Will I get all extended programs form the Photoshop CS3 download as it does not signify the extended version and should I deactivate or uninstall the product I installed from my disk before downloading from the site?

  • IPad mini with retina frequent random restart with 802 update

    I Have updated my iPad mini2 to iOS 802, since then it started randomly with blue screen. it restarts 1-2 times every hour During use. It is very much frustrating to use. any solution?