Keyboard Shortcuts
  • Hi there, I just installed FastScripts to try out and wanted to put some keyboard short cuts to existing scripts. I double click the script in the preferences area and the field for the short cut highlights but will not take any input. It remains '(none)'. What do I need to know about the keyboard shortcuts that I am missing?
  • The problem seems to be with the Keyboard Shortcuts Pane itself because it's flaky.

    1) Holding the Command key, I selected a script and clicked. I got the Keyboard Shortcuts pane with the script name highlighted. I typed in my chosen command (option-control-shift-G in this case) and the (none) did not change. However, the shortcut works. BUT I have no way to turn it off again!

    2) Trying again, I held down Command while double-clicking a different script, got the highlighted name with (none) ready to accept input, entered it, and it changed and the shortcut works. Then I went back to that entry highlighted the key command and deleted it. The shortcut entry changed to (none) but the key command still works - it hasn't been removed.

    Bottom line: Shortcut Pane has a big problem. You can't remove a shortcut once entered, and you can't see the shortcuts you have entered because they seem to come up (none).
  • Hi - this is a new issue to me. I haven't seen this happening. It will help a lot of if we can try to gather some more information. I'm curious as to whether either of you can find any suspicious output in the Console log on your Mac around the time of the attempted shortcut changes?

    In general, you should always be able to edit a script's shortcut by double-clicking the item in the Shortcuts pane. To delete a shortcut, you can hit the "delete" key while editing the shortcut, instead of entering any particular shortcut.

    If the shortcut edit is showing up but the text is not changing from "none" when you hit something, then the most likely cause is that something else is already set up to use that shortcut. For instance, if you've got another program installed that claims that shortcut, FastScripts may not be able to override it, and when you hit the key combo, that other application will be doing something and FastScripts will never get the keys.

    I think there are several improvements that could be made to the Shortcuts pane so it's more intutiive, but if you are hitting an unclaimed keystroke and FastScripts is not responding as expected, it's definitely a bug. Let me know if either of you can find any more clues from your Console logs.

    Thanks!

    Daniel
  • These are the only mentions of FastScripts (one after the other) in my Console Log.

    2005-08-27 12:42:01.334 FastScripts[1719] defaultScriptEditingApp failed to locate app information for given identifier: com.barebones.bbedit or signature:(null)
    2005-08-27 12:42:01.347 FastScripts[1719] *** Assertion failure in -[NSTextFieldCell _objectValue:forString:], AppKit.subproj/NSCell.m:1131
    2005-08-27 12:42:01.363 FastScripts[1719] Invalid parameter not satisfying: aString != nil

    I've checked carefully that I don't use the two shortcuts I tried, both complex:
    Option-Control-Shift-G and Option-Control-Shift-G, in case it matters what they are.

    Even after quitting FS and restarting it, they both say (none) and they both work.

    I'm running OS X 10.3.9, and FS 2.2.5(v16), and I'm perfectly willing to try more experiments if you outline them here.
  • Thanks, NovaScotian. That console log really helped! It definitely identified one problem and hopefully that is what has been affecting you. Notice how it says it couldn't find your script editor application? That failure caused a chain reaction which ultimately caused the Preference dialog to not get prepared correctly. After that happened, all bets are off. I changed the code to be more resilient to "editor not found" situations like this. Can you please try with this beta version of FastScripts?

    http://www.red-sweater.com/RedSweater/FastScripts2.2.6b1.zip

    It looks like you at one point had BBEdit configured as your shell script editor, but that app has since been deleted or is otherwise not locatable on your computer. You might want to reset the "Shell Script Editor" preference by selecting an app that is present on your computer, now. Before you do that, though, I'd love to know whether the above beta-release addresses your problem.

    Thanks!

    Daniel
  • FastScriptGuy: If you think this might be the same problem that is affecting you, then I encourage you to try the beta release posted above. If not, please check your console and see if there is anything interesting there. If you're not familiar with the console, you can open it from /Applications/Utilities/Console.app. Look in the log for anything near the bottom that shows FastScripts in the line...

    Thanks!
    Daniel
  • Daniel Jalkut said:
    Thanks, NovaScotian. That console log really helped! It definitely identified one problem and hopefully that is what has been affecting you. Notice how it says it couldn't find your script editor application? That failure caused a chain reaction which ultimately caused the Preference dialog to not get prepared correctly. After that happened, all bets are off. I changed the code to be more resilient to "editor not found" situations like this. Can you please try with this beta version of FastScripts?

    http://www.red-sweater.com/RedSweater/FastScripts2.2.6b1.zip

    It looks like you at one point had BBEdit configured as your shell script editor, but that app has since been deleted or is otherwise not locatable on your computer. You might want to reset the "Shell Script Editor" preference by selecting an app that is present on your computer, now. Before you do that, though, I'd love to know whether the above beta-release addresses your problem.

    Thanks!

    Daniel

    I had upgraded BBEdit to version 8 from 7 and neglected to "inform" FastScripts.

    The beta (2.2.6b1) fixed one of the two I reported. Now I can enter and modify the key.
    The other was my fault - I discovered (but had missed) that I have a QuicKey assigned to the same keys, so QK was grabbing my code before it got to FS.

    Final answer - Thanks; your beta works, and after testing that, I reset my shell script editor to BBEdit8 which works also.

    Eventually, I'm going to stop using QK which is a shadow of its former (preOSX) self, and do all of it's current functions from FS and AS. The one thing holding me back is that QK runs an AppleScript entered as text as a step in a sequence without running the script itself so there is no wait for a script application to open. I don't know how they do that, but it's a power feature.
  • NovaScotian said:
    I had upgraded BBEdit to version 8 from 7 and neglected to "inform" FastScripts.

    The beta (2.2.6b1) fixed one of the two I reported. Now I can enter and modify the key.
    The other was my fault - I discovered (but had missed) that I have a QuicKey assigned to the same keys, so QK was grabbing my code before it got to FS.

    Final answer - Thanks; your beta works, and after testing that, I reset my shell script editor to BBEdit8 which works also.

    Eventually, I'm going to stop using QK which is a shadow of its former (preOSX) self, and do all of it's current functions from FS and AS. The one thing holding me back is that QK runs an AppleScript entered as text as a step in a sequence without running the script itself so there is no wait for a script application to open. I don't know how they do that, but it's a power feature.

    Great to hear, Nova.

    It's theoretically possible that FastScripts could be modified to support arbitrary script text as an "action". Note however, that when you save a script as "script" (not an application) and run it from FastScripts, you should get about the same speed as raw text, *after the first run*. When you run a plain AppleScript file in FastScripts, it keeps that script in memory, so that any time you run the script again, it doesn't need to be loaded from the disk again.

    This should theoretically allow for comparable execution speeds between FS and QK for this purpose.

    On a related note, I am somewhat tempted to take FastScripts in the direction of a full-blown macro application like QuicKeys, but I haven't decided whether I really want to bite into that, or whether to do it as a completely new product.

    Definitely keep me posted about any changes to FastScripts that might make it more suitable for your needs.

    Daniel
  • Daniel said:
    It's theoretically possible that FastScripts could be modified to support arbitrary script text as an "action". Note however, that when you save a script as "script" (not an application) and run it from FastScripts, you should get about the same speed as raw text, *after the first run*. When you run a plain AppleScript file in FastScripts, it keeps that script in memory, so that any time you run the script again, it doesn't need to be loaded from the disk again.

    This should theoretically allow for comparable execution speeds between FS and QK for this purpose.

    Thanks... I didn't know that. Seems to me though that you only have to give me the option of marking a script to be kept in memory after the first run (and reloaded after a restart) so it'll always run immediately. If I want to free up memory, I'll unmark it (in preferences perhaps). That would be great for my e-mail notifier script for example, which I run many times a day, for one that checks on a server, for another that gets me the latest exchange rates, etc.
  • Hi Nova - the behavior you're describing is how FastScripts behaves for all AppleScript items currently. And since Mac OS X uses a virtual memory system that applies to all processes, if you don't use a script for a long time, it should be automatically "taken out of memory" by the system. If you then run that script again, it will be brought in from disk, but already prepared and everything allocated by FastScripts to run.

    So I think the current setup is probably the best balance between performance and memory use. If you have any other thoughts about how it could be improved, let me know.

    Daniel
  • Daniel Jalkut said:
    FastScriptGuy: If you think this might be the same problem that is affecting you, then I encourage you to try the beta release posted above. If not, please check your console and see if there is anything interesting there. If you're not familiar with the console, you can open it from /Applications/Utilities/Console.app. Look in the log for anything near the bottom that shows FastScripts in the line...

    Thanks!
    Daniel

    Hi there, I installed the new beta you have here, logged out and in again, and I can now make a short cut but the only time it worked, unexpectedly, is when the preference pane was open and I invoked the shortcut a couple of times in a row. I went to the console and I do not see anything at all in there about FastScripts.
  • Thanks, FSG - I wonder if something might be installed on your system that is required to reproduce the problem. I'm going to follow up with you on email to see if we can get to the bottom of this.
  • I've discovered (using the beta version) that storage of a shortcut is not necessarily a sure thing unless the script is opened for editing (option-clicked) and run in the script editor. Somehow, that "registers" the script with FS and a subsequent selection (command-click) will "take". I know this is fuzzy, but it seems to work. If this step is neglected, the change may appear in the preferences shortcuts pane, but it might not keep.
  • That's very interesting, Nova. The only thing I can think is that for some reason the script in question is not compiled at first, and then when you open and run it in Script Editor, it gets compiled.

    How are you writing these scripts, and does this problem only occur the very first time you try to associate a keystroke? Now that's it's been run once in Script Editor, can you change keystrokes at will in FastScripts?

    Thanks for your help,
    Daniel
  • Daniel Jalkut said:
    That's very interesting, Nova. The only thing I can think is that for some reason the script in question is not compiled at first, and then when you open and run it in Script Editor, it gets compiled.

    That's true. I've been moving scripts entered as text in QK that existed as compiled scripts under the FS menu and saving them in my Scripts Folder as .scpt files (FS starts scripts saved as .app so there's a wait to get it going and show its icon in the dock, but scripts saved as .scpt seem to run immediately). For each of these, just compiling them didn't seem to be enough - I had to actually run them once before the FS shortcut key worked properly.

    Daniel further said:
    Now that's it's been run once in Script Editor, can you change keystrokes at will in FastScripts?

    Yes. The preferences shortcut pane works perfectly. Must have something to do with the way the Script Editor saves scripts.

    No need to thank me - I like this software and want it to work as well as you do.

    Adam
  • Great info - if you could send me a copy of some .scpt file saved to your scripts folder before you run it with Script Editor, maybe I can use it to reproduce the same functionality over here.

    Daniel
Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!