Is it possible to make a global keyboard command for an Applescript application?

I have created an application with Applescript, and I want to create a global keyboard command that brings up an input dialogue.
If that's not possible, is there a way to make a dialogue appear when the Dock icon is clicked?

The regular keyboard shortcuts work with whatever application is currently active, so that leaves option number 2.  To add a dynamic menuu item to the dock menu, you can add a couple of handlers to the CocoaAppletAppDelegate.scpt, which is located in the bundle contents of the Cocoa-AppleScript applet (created when you use the File > New from Template menu item):
  on applicationDockMenu_(sender) -- dynamically add a menu item to the dock tile
    set myDockMenu to current application's NSMenu's alloc's initWithTitle_("") -- don't really need a title here
    myDockMenu's addItemWithTitle_action_keyEquivalent_("My spiffy new menu item", "menuAction:", "")
    return myDockMenu
  end applicationDockMenu_
  on menuAction_(sender) -- do something when the dock menu item is selected
    set menuTitle to sender's title() as text
    # do something
    tell current application to activate -- make sure dialog is in front
    display dialog "The " & quoted form of menuTitle & " menu item was clicked…"
    tell application "System Events" to keystroke tab using {command down} -- switch to previous application
  end menuAction_

Similar Messages

  • Is it possible to define a global keyboard shortcut for Exposure Adjustment?

    I often find myself having to get out of full-screen mode or having to pull up the Develop or Library module from the hidden right panel just to adjust exposure and nothing else (it is my most common adjustment).
    Is there some way to globally define a key so I can adjust exposure without having to exit full-screen?

    Globally? No.
    However, if you click on the word exposure, you can indeed adjust exposure with the + or - keys.
    I believe you'd have to do this on each photo, and if you click on another word in the Basic panel then that slider is now controlled by + or - (for example, if you click on contrast, then the + or - keys adjust contrast).

  • Is it possible to make a form in iWeb for people to fill in

    Is it possible to make a form in iWeb for people to fill in for people to subsribe

    There  are two possible form types that you can add to your website.  One is using a 3rd party form provider that, when filed in and sent, goes directly to you.  Expamples of them, JotForm and Wufoo can be seen here: Add Form
    Further down that page is the second type,  Form action forms, that use the visitors email application to send the response.  That may put off responders.  Take a look at both types.
    OT

  • Is it possible to make a log in page for Adobe Digital Publishing Professional Edition?

    I would like to create a log in page with key in username and password on the first page of the DPS App.
    Is it possible to make a log in page for Adobe Digital Publishing Professional Edition?

    No. You need enterprise edition to create a custom storefront.
    Neil

  • I downloaded CS6 and was told that it was possible to make a hard copy DVD for safety,is this correct and if so how is it done?.

    I downloaded CS6 and was told that it was possible to make a hard copy DVD for safety,is this correct and if so how is it done/.

    Use a DVD burning program:
    https://www.google.com/search?q=vdvd+burning+program&ie=utf-8&oe=utf-8&aq=t&rls=org.mozill a:en-US:official&client=firefo…

  • System prerences won't save keyboard commands for dashboard or desktop

    I clicked the checkboxes to turn on the keyboard commands for Dashboard and Desktop. I used control-up arrow for Dashboard, and control-down arrow for Desktop. When I restart, the commands don't work. I thought maybe I had made System Preferences crash, so I made a point of quitting right after making the change. When I restarted, the commands were disabled again. This has happened several times.
    What gives?

    At a guess, I would think this error code has to do with the video artifacts you are experiencing. You might try reseating all the cables to the display. If the position of the screen makes a difference, there may be damage to a cable, particularly where it goes through the hinge.
    Apple is the keeper of the error codes. If you have access to an Apple Store, you could probably ask about this.
    Don't know about the other intermittent problems. Does an external keyboard work? If so, there's likely a problem with the internal, maybe even again, a cable or connection.
    You could also try creating a new use account and see if the keyboard and mouse problems persist. If not, there could be some sort of software corruption in your usual account. Ditto with the freezing.
    Good luck!

  • Can I change the keyboard command for full screen? I don't see the option in preferences.

    Can i change the keyboard command for entering Full Screen? I don't see the option in the keyboard preferences pane.

    My midi set up is fairly extensive, and what I've done is keep an up to date diagram of all my midi interfaces and device connections. I use this as the desktop background on my studio mac, and just hit F11 when I need to reference something. Simple but effective.

  • I need to find the keyboard command for "PrintScreen"

    I'm using a MacBook Pro with Mac OS X Version 10.7.5.
    Processor 2.4 GHz intel core 2 Duo.
    I'm just looking for the keyboard command for the "PrintScreen" function.
    Any help?

    Thanks, Niel,
    The only way that I could print all the columns on the page was to use the printscreen function. Regular printing cut off a crucial portion of the information.
    If you know of any way to bring the print screen to full size - mine would only print in a compressed version - I'd love to know that as well.
    Your answer, however, was very helpful.
    Thanks,
    Michael

  • Is it Possible to Make a Flash Playable DVD for the iTouch

    Is it possible to make the same kind of "virtual" DVD player file in Encore for an iTouch audience that works like the Flash output in Encore?
    I am under the impression that the 3G iTouch can play flash files but if that is not correct then I guess my question is no applicable.  I just felt that some interactive linking would be possible since the iTouch is equipped with a WiFi connection to the internet.  Any thoughts or suggestions?
    Thanks!!

    John,
    You know that Encore has a FLV output that produced a flash file that
    behaves exactly as a DVD player with player controls.  This is why I felt
    that this was possible, the flash file is certainly not a DVD formatted
    file.

  • Is it possible to make a BIOS usb key for a PC on a MAC?

    I am not sure where to ask this question but If I needed to make a BIOS flash drive for a PC computer such as an HP Laptop or Desktop, would it be possible to do on the MacBook Pro running OS X Mountain Lion? I ask this because I thought I was going to need to make a BIOS flash update for an HP system and I did not want to use a CD to do it. I had downloaded the flash drive tool from HP which under a windows system would make a USB flash drive. I tried running the tool under Windows 7 on both a VM session and a boot camp session but both times I would get a message saying something similar to "You don't have permission" even though I was doing it as an admin. Turns out I didn't  need it anyway but for future references can I even make a bootable usb key for a PC on a Mac?

    Thank you for the info. I found the problem that I had under the Windows 7 on Mac was the extractor(hpusbf.exe) was not running under the Admin mode so it wasn't given permission to modify the usb File system. I think the other issue is that I was trying this on a 8GB flash drive and it kept telling me the partition was too large. I found the switch to use 2048 blocks and it created  a bootable flash drive. The problem I have now is when I tried it on my old HP laptop, it boots up saying "FreeDos Fat" and stops. So I don't know what is going on but I think I am going to stick to making bootable CDs I just have to get some Re-writable CDs so I don't waste the CDs.
    I tried your solution on the mac side and tried copying the dos files over but the drive would not boot. I think the problem is that the command.com file is not set as a system file. I am not sure how you can set command.com as a system file for windows under the MAC operating system. I know in windows you use attrib +S filename.

  • Global-Cache-Manager for Multi-Environment Applications

    Hi,
    Within our server implementation we provide a "multi-project" environment. Each project is fully isolated from the rest of the server e.g. in terms of file-system usage, backup and other ressources. As one might expect the way to go is using a single VM with multiple BDB environments.
    Obviously each JE-Environment uses its own cache. Within a our environment with dynamic numbers of active projects this causes a problem because the optimal cache configuration within a given memory frame depends on the JE-Environments in use BUT there is no way to define a global JE cache for ALL JE-Environments.
    Our "plan of attack" is to implement a Global-Cache-Manager to dynamicly configure the cache sizes of all active BDB environments depending on the given global cache size.
    Like Federico proposed the starting point for determining the optimal cache setting at load time will be a modification to the DbCacheSize utility so that the return value can be picked up easily, rather than printed to stdout. After that the EnvironmentMutableConfig.setCacheSize will be used to set the cache size. If there is enough Cache-RAM available we could even set a larger cache but I do not know if that really makes sense.
    If Cache-Memory is getting tight loading another BDB environment means decreasing cache sizes for the already loaded environments. This is also done via EnvironmentMutableConfig.setCacheSize. Are there any timing conditions one should obey before assuming the memory is really available? To determine if there are any BDB environments that do not use their cache one could query each cache utilization using EnvironmentStats.getCacheDataBytes() and getCacheTotalBytes().
    Are there any comments to this plan? Is there perhaps a better solution or even an implementation?
    Do you think a global cache manager is something worth back-donating?
    Related Postings: Multiple envs in one process?
    Stefan Walgenbach

    Here is the updated DbCacheSize.java to allow calling it with an API.
    Charles Lamb
    * See the file LICENSE for redistribution information.
    * Copyright (c) 2005-2006
    *      Oracle Corporation.  All rights reserved.
    * $Id: DbCacheSize.java,v 1.8 2006/09/12 19:16:59 cwl Exp $
    package com.sleepycat.je.util;
    import java.io.File;
    import java.io.PrintStream;
    import java.math.BigInteger;
    import java.text.NumberFormat;
    import java.util.Random;
    import com.sleepycat.je.Database;
    import com.sleepycat.je.DatabaseConfig;
    import com.sleepycat.je.DatabaseEntry;
    import com.sleepycat.je.DatabaseException;
    import com.sleepycat.je.Environment;
    import com.sleepycat.je.EnvironmentConfig;
    import com.sleepycat.je.EnvironmentStats;
    import com.sleepycat.je.OperationStatus;
    import com.sleepycat.je.dbi.MemoryBudget;
    import com.sleepycat.je.utilint.CmdUtil;
    * Estimating JE in-memory sizes as a function of key and data size is not
    * straightforward for two reasons. There is some fixed overhead for each btree
    * internal node, so tree fanout and degree of node sparseness impacts memory
    * consumption. In addition, JE compresses some of the internal nodes where
    * possible, but compression depends on on-disk layouts.
    * DbCacheSize is an aid for estimating cache sizes. To get an estimate of the
    * in-memory footprint for a given database, specify the number of records and
    * record characteristics and DbCacheSize will return a minimum and maximum
    * estimate of the cache size required for holding the database in memory.
    * If the user specifies the record's data size, the utility will return both
    * values for holding just the internal nodes of the btree, and for holding the
    * entire database in cache.
    * Note that "cache size" is a percentage more than "btree size", to cover
    * general environment resources like log buffers. Each invocation of the
    * utility returns an estimate for a single database in an environment.  For an
    * environment with multiple databases, run the utility for each database, add
    * up the btree sizes, and then add 10 percent.
    * Note that the utility does not yet cover duplicate records and the API is
    * subject to change release to release.
    * The only required parameters are the number of records and key size.
    * Data size, non-tree cache overhead, btree fanout, and other parameters
    * can also be provided. For example:
    * $ java DbCacheSize -records 554719 -key 16 -data 100
    * Inputs: records=554719 keySize=16 dataSize=100 nodeMax=128 density=80%
    * overhead=10%
    *    Cache Size      Btree Size  Description
    *    30,547,440      27,492,696  Minimum, internal nodes only
    *    41,460,720      37,314,648  Maximum, internal nodes only
    *   114,371,644     102,934,480  Minimum, internal nodes and leaf nodes
    *   125,284,924     112,756,432  Maximum, internal nodes and leaf nodes
    * Btree levels: 3
    * This says that the minimum cache size to hold only the internal nodes of the
    * btree in cache is approximately 30MB. The maximum size to hold the entire
    * database in cache, both internal nodes and datarecords, is 125Mb.
    public class DbCacheSize {
        private static final NumberFormat INT_FORMAT =
            NumberFormat.getIntegerInstance();
        private static final String HEADER =
            "    Cache Size      Btree Size  Description\n" +
        //   12345678901234  12345678901234
        //                 12
        private static final int COLUMN_WIDTH = 14;
        private static final int COLUMN_SEPARATOR = 2;
        private long records;
        private int keySize;
        private int dataSize;
        private int nodeMax;
        private int density;
        private long overhead;
        private long minInBtreeSize;
        private long maxInBtreeSize;
        private long minInCacheSize;
        private long maxInCacheSize;
        private long maxInBtreeSizeWithData;
        private long maxInCacheSizeWithData;
        private long minInBtreeSizeWithData;
        private long minInCacheSizeWithData;
        private int nLevels = 1;
        public DbCacheSize (long records,
                   int keySize,
                   int dataSize,
                   int nodeMax,
                   int density,
                   long overhead) {
         this.records = records;
         this.keySize = keySize;
         this.dataSize = dataSize;
         this.nodeMax = nodeMax;
         this.density = density;
         this.overhead = overhead;
        public long getMinCacheSizeInternalNodesOnly() {
         return minInCacheSize;
        public long getMaxCacheSizeInternalNodesOnly() {
         return maxInCacheSize;
        public long getMinBtreeSizeInternalNodesOnly() {
         return minInBtreeSize;
        public long getMaxBtreeSizeInternalNodesOnly() {
         return maxInBtreeSize;
        public long getMinCacheSizeWithData() {
         return minInCacheSizeWithData;
        public long getMaxCacheSizeWithData() {
         return maxInCacheSizeWithData;
        public long getMinBtreeSizeWithData() {
         return minInBtreeSizeWithData;
        public long getMaxBtreeSizeWithData() {
         return maxInBtreeSizeWithData;
        public int getNLevels() {
         return nLevels;
        public static void main(String[] args) {
            try {
                long records = 0;
                int keySize = 0;
                int dataSize = 0;
                int nodeMax = 128;
                int density = 80;
                long overhead = 0;
                File measureDir = null;
                boolean measureRandom = false;
                for (int i = 0; i < args.length; i += 1) {
                    String name = args;
    String val = null;
    if (i < args.length - 1 && !args[i + 1].startsWith("-")) {
    i += 1;
    val = args[i];
    if (name.equals("-records")) {
    if (val == null) {
    usage("No value after -records");
    try {
    records = Long.parseLong(val);
    } catch (NumberFormatException e) {
    usage(val + " is not a number");
    if (records <= 0) {
    usage(val + " is not a positive integer");
    } else if (name.equals("-key")) {
    if (val == null) {
    usage("No value after -key");
    try {
    keySize = Integer.parseInt(val);
    } catch (NumberFormatException e) {
    usage(val + " is not a number");
    if (keySize <= 0) {
    usage(val + " is not a positive integer");
    } else if (name.equals("-data")) {
    if (val == null) {
    usage("No value after -data");
    try {
    dataSize = Integer.parseInt(val);
    } catch (NumberFormatException e) {
    usage(val + " is not a number");
    if (dataSize <= 0) {
    usage(val + " is not a positive integer");
    } else if (name.equals("-nodemax")) {
    if (val == null) {
    usage("No value after -nodemax");
    try {
    nodeMax = Integer.parseInt(val);
    } catch (NumberFormatException e) {
    usage(val + " is not a number");
    if (nodeMax <= 0) {
    usage(val + " is not a positive integer");
    } else if (name.equals("-density")) {
    if (val == null) {
    usage("No value after -density");
    try {
    density = Integer.parseInt(val);
    } catch (NumberFormatException e) {
    usage(val + " is not a number");
    if (density < 1 || density > 100) {
    usage(val + " is not betwen 1 and 100");
    } else if (name.equals("-overhead")) {
    if (val == null) {
    usage("No value after -overhead");
    try {
    overhead = Long.parseLong(val);
    } catch (NumberFormatException e) {
    usage(val + " is not a number");
    if (overhead < 0) {
    usage(val + " is not a non-negative integer");
    } else if (name.equals("-measure")) {
    if (val == null) {
    usage("No value after -measure");
    measureDir = new File(val);
    } else if (name.equals("-measurerandom")) {
    measureRandom = true;
    } else {
    usage("Unknown arg: " + name);
    if (records == 0) {
    usage("-records not specified");
    if (keySize == 0) {
    usage("-key not specified");
         DbCacheSize dbCacheSize = new DbCacheSize
              (records, keySize, dataSize, nodeMax, density, overhead);
         dbCacheSize.caclulateCacheSizes();
         dbCacheSize.printCacheSizes(System.out);
    if (measureDir != null) {
    measure(System.out, measureDir, records, keySize, dataSize,
    nodeMax, measureRandom);
    } catch (Throwable e) {
    e.printStackTrace(System.out);
    private static void usage(String msg) {
    if (msg != null) {
    System.out.println(msg);
    System.out.println
    ("usage:" +
    "\njava " + CmdUtil.getJavaCommand(DbCacheSize.class) +
    "\n -records <count>" +
    "\n # Total records (key/data pairs); required" +
    "\n -key <bytes> " +
    "\n # Average key bytes per record; required" +
    "\n [-data <bytes>]" +
    "\n # Average data bytes per record; if omitted no leaf" +
    "\n # node sizes are included in the output" +
    "\n [-nodemax <entries>]" +
    "\n # Number of entries per Btree node; default: 128" +
    "\n [-density <percentage>]" +
    "\n # Percentage of node entries occupied; default: 80" +
    "\n [-overhead <bytes>]" +
    "\n # Overhead of non-Btree objects (log buffers, locks," +
    "\n # etc); default: 10% of total cache size" +
    "\n [-measure <environmentHomeDirectory>]" +
    "\n # An empty directory used to write a database to find" +
    "\n # the actual cache size; default: do not measure" +
    "\n [-measurerandom" +
    "\n # With -measure insert randomly generated keys;" +
    "\n # default: insert sequential keys");
    System.exit(2);
    private void caclulateCacheSizes() {
    int nodeAvg = (nodeMax * density) / 100;
    long nBinEntries = (records * nodeMax) / nodeAvg;
    long nBinNodes = (nBinEntries + nodeMax - 1) / nodeMax;
    long nInNodes = 0;
         long lnSize = 0;
    for (long n = nBinNodes; n > 0; n /= nodeMax) {
    nInNodes += n;
    nLevels += 1;
    minInBtreeSize = nInNodes *
         calcInSize(nodeMax, nodeAvg, keySize, true);
    maxInBtreeSize = nInNodes *
         calcInSize(nodeMax, nodeAvg, keySize, false);
         minInCacheSize = calculateOverhead(minInBtreeSize, overhead);
         maxInCacheSize = calculateOverhead(maxInBtreeSize, overhead);
    if (dataSize > 0) {
    lnSize = records * calcLnSize(dataSize);
         maxInBtreeSizeWithData = maxInBtreeSize + lnSize;
         maxInCacheSizeWithData = calculateOverhead(maxInBtreeSizeWithData,
                                  overhead);
         minInBtreeSizeWithData = minInBtreeSize + lnSize;
         minInCacheSizeWithData = calculateOverhead(minInBtreeSizeWithData,
                                  overhead);
    private void printCacheSizes(PrintStream out) {
    out.println("Inputs:" +
    " records=" + records +
    " keySize=" + keySize +
    " dataSize=" + dataSize +
    " nodeMax=" + nodeMax +
    " density=" + density + '%' +
    " overhead=" + ((overhead > 0) ? overhead : 10) + "%");
    out.println();
    out.println(HEADER);
    out.println(line(minInBtreeSize, minInCacheSize,
                   "Minimum, internal nodes only"));
    out.println(line(maxInBtreeSize, maxInCacheSize,
                   "Maximum, internal nodes only"));
    if (dataSize > 0) {
    out.println(line(minInBtreeSizeWithData,
                   minInCacheSizeWithData,
                   "Minimum, internal nodes and leaf nodes"));
    out.println(line(maxInBtreeSizeWithData,
                   maxInCacheSizeWithData,
    "Maximum, internal nodes and leaf nodes"));
    } else {
    out.println("\nTo get leaf node sizing specify -data");
    out.println("\nBtree levels: " + nLevels);
    private int calcInSize(int nodeMax,
                   int nodeAvg,
                   int keySize,
                   boolean lsnCompression) {
    /* Fixed overhead */
    int size = MemoryBudget.IN_FIXED_OVERHEAD;
    /* Byte state array plus keys and nodes arrays */
    size += MemoryBudget.byteArraySize(nodeMax) +
    (nodeMax * (2 * MemoryBudget.ARRAY_ITEM_OVERHEAD));
    /* LSN array */
         if (lsnCompression) {
         size += MemoryBudget.byteArraySize(nodeMax * 2);
         } else {
         size += MemoryBudget.BYTE_ARRAY_OVERHEAD +
    (nodeMax * MemoryBudget.LONG_OVERHEAD);
    /* Keys for populated entries plus the identifier key */
    size += (nodeAvg + 1) * MemoryBudget.byteArraySize(keySize);
    return size;
    private int calcLnSize(int dataSize) {
    return MemoryBudget.LN_OVERHEAD +
    MemoryBudget.byteArraySize(dataSize);
    private long calculateOverhead(long btreeSize, long overhead) {
    long cacheSize;
    if (overhead == 0) {
    cacheSize = (100 * btreeSize) / 90;
    } else {
    cacheSize = btreeSize + overhead;
         return cacheSize;
    private String line(long btreeSize,
                   long cacheSize,
                   String comment) {
    StringBuffer buf = new StringBuffer(100);
    column(buf, INT_FORMAT.format(cacheSize));
    column(buf, INT_FORMAT.format(btreeSize));
    column(buf, comment);
    return buf.toString();
    private void column(StringBuffer buf, String str) {
    int start = buf.length();
    while (buf.length() - start + str.length() < COLUMN_WIDTH) {
    buf.append(' ');
    buf.append(str);
    for (int i = 0; i < COLUMN_SEPARATOR; i += 1) {
    buf.append(' ');
    private static void measure(PrintStream out,
    File dir,
    long records,
    int keySize,
    int dataSize,
    int nodeMax,
    boolean randomKeys)
    throws DatabaseException {
    String[] fileNames = dir.list();
    if (fileNames != null && fileNames.length > 0) {
    usage("Directory is not empty: " + dir);
    Environment env = openEnvironment(dir, true);
    Database db = openDatabase(env, nodeMax, true);
    try {
    out.println("\nMeasuring with cache size: " +
    INT_FORMAT.format(env.getConfig().getCacheSize()));
    insertRecords(out, env, db, records, keySize, dataSize, randomKeys);
    printStats(out, env,
    "Stats for internal and leaf nodes (after insert)");
    db.close();
    env.close();
    env = openEnvironment(dir, false);
    db = openDatabase(env, nodeMax, false);
    out.println("\nPreloading with cache size: " +
    INT_FORMAT.format(env.getConfig().getCacheSize()));
    preloadRecords(out, db);
    printStats(out, env,
    "Stats for internal nodes only (after preload)");
    } finally {
    try {
    db.close();
    env.close();
    } catch (Exception e) {
    out.println("During close: " + e);
    private static Environment openEnvironment(File dir, boolean allowCreate)
    throws DatabaseException {
    EnvironmentConfig envConfig = new EnvironmentConfig();
    envConfig.setAllowCreate(allowCreate);
    envConfig.setCachePercent(90);
    return new Environment(dir, envConfig);
    private static Database openDatabase(Environment env, int nodeMax,
    boolean allowCreate)
    throws DatabaseException {
    DatabaseConfig dbConfig = new DatabaseConfig();
    dbConfig.setAllowCreate(allowCreate);
    dbConfig.setNodeMaxEntries(nodeMax);
    return env.openDatabase(null, "foo", dbConfig);
    private static void insertRecords(PrintStream out,
    Environment env,
    Database db,
    long records,
    int keySize,
    int dataSize,
    boolean randomKeys)
    throws DatabaseException {
    DatabaseEntry key = new DatabaseEntry();
    DatabaseEntry data = new DatabaseEntry(new byte[dataSize]);
    BigInteger bigInt = BigInteger.ZERO;
    Random rnd = new Random(123);
    for (int i = 0; i < records; i += 1) {
    if (randomKeys) {
    byte[] a = new byte[keySize];
    rnd.nextBytes(a);
    key.setData(a);
    } else {
    bigInt = bigInt.add(BigInteger.ONE);
    byte[] a = bigInt.toByteArray();
    if (a.length < keySize) {
    byte[] a2 = new byte[keySize];
    System.arraycopy(a, 0, a2, a2.length - a.length, a.length);
    a = a2;
    } else if (a.length > keySize) {
    out.println("*** Key doesn't fit value=" + bigInt +
    " byte length=" + a.length);
    return;
    key.setData(a);
    OperationStatus status = db.putNoOverwrite(null, key, data);
    if (status == OperationStatus.KEYEXIST && randomKeys) {
    i -= 1;
    out.println("Random key already exists -- retrying");
    continue;
    if (status != OperationStatus.SUCCESS) {
    out.println("*** " + status);
    return;
    if (i % 10000 == 0) {
    EnvironmentStats stats = env.getStats(null);
    if (stats.getNNodesScanned() > 0) {
    out.println("*** Ran out of cache memory at record " + i +
    " -- try increasing the Java heap size ***");
    return;
    out.print(".");
    out.flush();
    private static void preloadRecords(final PrintStream out,
    final Database db)
    throws DatabaseException {
    Thread thread = new Thread() {
    public void run() {
    while (true) {
    try {
    out.print(".");
    out.flush();
    Thread.sleep(5 * 1000);
    } catch (InterruptedException e) {
    break;
    thread.start();
    db.preload(0);
    thread.interrupt();
    try {
    thread.join();
    } catch (InterruptedException e) {
    e.printStackTrace(out);
    private static void printStats(PrintStream out,
    Environment env,
    String msg)
    throws DatabaseException {
    out.println();
    out.println(msg + ':');
    EnvironmentStats stats = env.getStats(null);
    out.println("CacheSize=" +
    INT_FORMAT.format(stats.getCacheTotalBytes()) +
    " BtreeSize=" +
    INT_FORMAT.format(stats.getCacheDataBytes()));
    if (stats.getNNodesScanned() > 0) {
    out.println("*** All records did not fit in the cache ***");

  • De-activating keyboard command for iTunes

    I want to use control-option-space for another program.  
    Currently it causes iTunes to open. To disable this through the Keyboard Prefs panel I need to know the exact menu item name, but it does not appear in iTunes's menu so I cannot do that.

    We're just users here.  Send feedback -- including feature requests -- to Apple via "Aperture→Provide Aperture Feedback".
    There is no keyboard command.  Aperture uses the mouse "scroll" command.  You may turn up a utility which allows you to map the mouse commands to keyboard shortcuts.
    You might also search the forum for posts on resizing Brushes with the Intuos4 tablet.  There may be a work-around which you can apply to your trackball.

  • How do I generate a list of keyboard shortcuts for any given application

    I want to generate a list of keyboard shortcuts for all of the applications I have on my Mac. I want the list to be a simple text (or rtf) file that I can edit and organize. (By edit, I don't mean change the shortcuts, only the report of them.)
    I was using Key Cue, but it does not let me save the list to a text file.
    I want this for several purposes. One is to have a easy to reference list of shortcuts to learn. Another is to find unused key combinations that I can use for my own keyboard shortcuts that I create with DefaultKeyBinding.dict.
    Note: The program doesn't have to an OS X app. A program that runs from a shell without a GUI is plenty adequate.
    If there is a way to read the keyboard commands from a plist list or other such file, and any of you know the format for these or where I can find them, I can write a Perl script myself to do it.

    Well, the info is stored in...
    /Users/YourUserName/Library/Preferences/com.apple.universalaccess.plist
    PlistPro has a way to convert it to ASCII, but you'll srtill have work to do, as...
    {enabled = 1; key = 20; modifier = 1179648; sybmolichotkey = 28; },
    {enabled = 1; key = 20; modifier = 1441792; sybmolichotkey = 29; },
    {enabled = 1; key = 21; modifier = 1179648; sybmolichotkey = 30; },
    {enabled = 1; key = 21; modifier = 1441792; sybmolichotkey = 31; },
    {enabled = 0; key = 28; modifier = 1572864; sybmolichotkey = 15; },
    {enabled = 0; key = 27; modifier = 1572864; sybmolichotkey = 19; },
    {enabled = 0; key = 24; modifier = 1572864; sybmolichotkey = 17; },
    {enabled = 0; key = 47; modifier = 1835008; sybmolichotkey = 25; },
    {enabled = 0; key = 43; modifier = 1835008; sybmolichotkey = 26; },
    {enabled = 0; key = 28; modifier = 1835008; sybmolichotkey = 21; },
    {enabled = 0; key = 96; modifier = 1048576; sybmolichotkey = 59; },
    {enabled = 1; key = 122; modifier = 262144; sybmolichotkey = 12; },
    {enabled = 0; key = 120; modifier = 262144; sybmolichotkey = 7; },
    {enabled = 0; key = 99; modifier = 262144; sybmolichotkey = 8; },
    {enabled = 0; key = 118; modifier = 262144; sybmolichotkey = 9; },
    {enabled = 0; key = 96; modifier = 262144; sybmolichotkey = 10; },
    {enabled = 0; key = 97; modifier = 262144; sybmolichotkey = 11; },
    {enabled = 1; key = 50; modifier = 1048576; sybmolichotkey = 27; },
    {enabled = 1; key = 98; modifier = 262144; sybmolichotkey = 13; },
    {enabled = 1; key = 50; modifier = 1572864; sybmolichotkey = 51; },
    {enabled = 1; key = 100; modifier = 262144; sybmolichotkey = 57; },
    {enabled = 1; key = 17; modifier = 1572864; sybmolichotkey = 50; },
    {enabled = 1; key = 2; modifier = 1572864; sybmolichotkey = 52; },
    {enabled = 0; key = 105; modifier = 0; sybmolichotkey = 32; },
    {enabled = 0; key = 109; modifier = 0; sybmolichotkey = 33; },
    {enabled = 0; key = 103; modifier = 0; sybmolichotkey = 36; },
    {enabled = 0; key = 109; modifier = 0; sybmolichotkey = 62; },
    {enabled = 0; key = 49; modifier = 1048576; sybmolichotkey = 60; },
    {enabled = 0; key = 49; modifier = 1572864; sybmolichotkey = 61; },
    {enabled = 1; key = 2; modifier = 1310720; sybmolichotkey = 70; },
    {enabled = 1; key = 49; modifier = 1048576; sybmolichotkey = 64; },
    {enabled = 1; key = 49; modifier = 1572864; sybmolichotkey = 65; },
    {enabled = 0; key = 53; modifier = 1048576; sybmolichotkey = 73; },
    {enabled = 1; key = 107; modifier = 0; sybmolichotkey = 53; },
    {enabled = 1; key = 113; modifier = 0; sybmolichotkey = 54; }

  • Set global font size for the whole application.

    Is there a way of setting a font globally
    What I mean I want to set a font size for the whole application.
    Is this posable ??
    Thanks Craig

    After posting over 300 questions I would think you would be passed the "New to Java TechnologY" stage.
    The answer for Swing applications is yes this can be done.
    I don't know how to do it for AWT components.
    Since you posted the question in this forum (as oppose to the Swing forum for Swing related problems), I'm assuming this is an AWT related question and therefore I can't help you.

  • Can I create a keyboard command for the Ken Burns effect?

    Friends,
    I am creating a short video that consists of about 40 stills and a few video clips.  For each of the stills I want to create a Ken Burns effect.  I know that there is a keyboard command to open the crop tool.  Can I create a keyboard command that opens the Ken Burns editor?  I guess the broader question is whether I can create a macro that combines a keystroke and one or more mouse clicks?
    Thanks!
    Steve

    The Keyboard-shortcuts-editor
    ⌥ - ⌘ - K
    doesn't list the 'Ken Burns'-effect as 'shortcutable' …
    And I doubt, that even Automator
    http://support.apple.com/kb/HT2488?viewlocale=en_US
    would createany useful 'shortcuts':
    Each picture is different - so, how should a 'standardised' KB work?
    What does work indeed , is copy/paste of Attributes:
    create your KB for clip#1
    hit cmd-c
    select clip#2 (or many) hit ⇧-⌘-V and select the 'crop' attributes ...

Maybe you are looking for