FastScripts 3.0 Sneak Peek

Just FYI to all regarding the previous thread: I’m not using a SymLink. The library is in the usual User>Scripting Libraries folder.

The script is saved as .scpt, not a bundle. I do use Dropbox, but the script is in the user library Scripts folder, so not on Dropbox.

So other than the error being the same, I’m not seeing anything that applies from the previous thread.

@rayrobertson one thing to try: you can rename one version of FastScripts, say FastScripts 3, and then have both versions running. It would be interesting to know if the problem, if it appears again, happens in both versions.

(And yes, your issue does sound different from that in the other thread.)

@ShaneStanley It’s probably worth noting that the actual script will always be running in a process named “RSScriptRunner”, so I don’t know if the name of the host app is likely to matter so much. But I wonder if having multiple apps on the system, sometimes running in tandem, and all invoking scripts, could cause the symptom Ray is reporting?

The renaming is really so both versions can live in /Applications.

I don’t think so. I mean, I suspect a lot of FastScripts users still also have Apple’s Scripts menu still running too (for no particular reason).

@rayrobertson could also try removing the unneeded use framework statements from his test script, although I can’t see why it would matter. But it might help narrow things down further.

I keep thinking that the one thing we know about script libraries is that AS caches them on a per-instance basis. I presume you’re using the runner’s default instance, but I wonder whether it would be worth trying with a new instance.

Thanks for the tip. In spite of how much weird stuff I know about AppleScript and making a tool like FastScripts over the years, I’m still a little foggy about some of these finer points. @rayrobertson if you want to drop me a line at support@redsweater.com, I can experiement with making versions of FastScripts that behave differently and see if we can get to the bottom of this!

@rayrobertson, one more question: what version of RegexAndStuffLib are you running?

@ShaneStanley It’s 1.0.7. I’ll see if I can get this to occur again and check out the other suggestions.

I just released FastScripts 3.0b32 which includes a few substantial changes:

  • Running scripts now appear in the FastScripts menu and can be force-stopped
  • Scripts are no longer run on the same script runner process. A fresh process is used for each invocation
  • Fix the ordering of items in the recent scripts submenu so that most recent scripts are at the top

“Check for Update” from a previous beta, or download directly here: https://redsweater.com/fastscripts/FastScripts3.0b32.zip

I’ be curious @rayrobertson if this change to run scripts in a new process every time affects the behavior you’re seeing with RegexAndStuffLib at all.

Thanks, Daniel.

I have not been able to reproduce the error condition yet. I’ll keep an eye on it. FastScripts b32 does seem to be running scripts much faster. I repeated the call to the regex library 10,000 times and it is taking 51 seconds total each time. That’s comparable to a “fresh” launch of SD8 beta. However, SD seems to run in to a low memory state at times, and the same script took 250 seconds (fans kicking on, SD appearing to lock, but not quite).

That’s all very unscientific, though, as with earlier testing both SD and FS appeared to wildly vary from run to run in how long it would take to complete—not sure if that issue is isolate to library calls, or RegEx libraries call only, or vanilla scripts as well. For now, though FS, seems consistent.

Feedback: I’d rather not have “Stop script” in a submenu. Any chance you could just make the menu item “Stop ScriptNameHere” so we can choose it quickly. It would be even better if that menu item were at the very top of the FS menu. And, best of all, if we could have a keyboard shortcut to stop the “last invoked script” or something like that.

And now, getting really greedy, could you make the FastScript menu icon flash or something while a script process is running?

Thanks.

Thanks for the additional feedback and speed sanity check. The “Stop Script” UI is very preliminary. I expect to amend those menu items to show progress information, and probably support a UI to cancel the script in a custom view. Not sure yet, but just wanted to get something functional in ASAP.

I don’t know if I anticipate that many people wanting to have a keyboard shortcut to kill the last script they ran, but your suggestion makes me think it would be a great idea to support accessing and canceling running scripts via FastScript’s own scripting dictionary. With this, you could easily add a script to provide just that functionality.

I do have some thoughts about showing activity in the icon somehow while scripts are running. I’ll probably get to that before the final release.

If you’re looking for work :wink:, I think it would be useful for FastScripts to be able to call a script’s open handler. So if it detected that a script has an open handler, it would send an event to the Finder to get the current selection, and then pass that in an open event to the script.

I’d envisage one of two things:

  • Scripts with an open handler would appear with some signifying icon in the menu; or
  • Some key combination would switch between showing/calling scripts with open handlers versus run handlers.

I know it’s easy enough to have scripts get the selection from the Finder themselves, but I think the real value here would be making it obvious in the UI what’s required for a particular script.

I finally saw the RegEx error again, but can only report that it is intermittent. Removing the use frameworks statements did not seem to help. This time, it only occurred in FastScripts 3 beta, not FastScripts 2, but I can’t report that as a definite case due to the intermittent nature.

The smaller tests versions of the script using regex all worked this time. My larger real-world script sometimes gave the RegEx error for two consecutive runs, but then on the third run, when I had changed nothing, it worked. That’s literally running the script back-to-back-to-back from FastScripts 3.

So intermittent is definitely the word, and I don’t see much hope of replicating this reliably to help anyone find a workaround.

How large a script would that be?

It’s less than 400 lines.

@redsweater, let me describe a interesting workflow.

The multitouch trackpad have 4 zoons,
ex. upper left and right and lower left and right.

I have test with right hand 1 finger to 3 finger (1-3 touch events).

Key = q

Shortcuts possibility:

1 touch upper left + q
2 touch upper left + q
3 touch upper left + q

1 touch upper right + q
2 touch upper right + q
3 touch upper right + q

1 touch lower left + q
2 touch lower left + q
3 touch lower left + q

1 touch lower right + q
2 touch lower right + q
3 touch lower right + q

2 touch upper right + 1 touch lower right + q
2 touch upper left + 1 touch lower left + q
3 touch upper right + 1 touch lower right + q
3 touch upper left + 1 touch lower left + q

1 touch upper right + 1 touch lower left + q
1 touch upper right + 1 touch lower right + q
1 touch upper left + 1 touch lower left + q
1 touch upper left + 1 touch lower right + q

In this example we have made 20 different keyboard shortcuts from the same key q
The trackpad becomes the modifiers key for the key q. (keyboard key q)
Today we use combinations of modifiers keys to extend the key q with shortcuts.
And its not always the best practice to execute. In this example we only use key q
but most keyboards have 100 keys. In other words 20 multiply with 100 is 2000
different shortcuts combinations. :slight_smile:

Happy Valentine

Thanks for clarifying Fredrik, that does sound really cool! Probably not going to happen for 3.0 but I can keep it in mind for later.

@redsweater, fingers crossed… :slight_smile:

In mean time here is example of a user how have take it to next level
and use midi to do it. It will give you some ideas what is possible.

And with ideas from Sensel we could have custom layouts for touch device that could communicate with a mac.

Trackpad or any touch device is truly powerful and useful.

Hi @ionah - thanks again for this feedback. I wanted to let you know that in the latest FastScripts 3.0 beta (3.0b38), I’ve addressed this issue. You should be able to invoke scripts that were freshly added since the last time the FS menu icon was clicked, and conversely, you will no longer be able to invoke a script that was since removed. FastScripts now dynamically updates the scripts at the portion of the script hierarchy where you are trying to invoke. Let me know if you spot any other issues!

Hi @redsweater

That’s great!

Unfortunately, I will not be able to send you feedback on it, as I’m stuck on High Sierra: I can’t find the time to make the update.

I hope I will be back in a couple of weeks with a brand new Catalina installed.
:wink:

Cool, thanks for letting me know. It will be waiting for you when you eventually get a chance to update.