technomorph's picture

@technomorph

technomorph's picture
use AppleScript version "2.4" -- Yosemite (10.10) or later
use framework "Foundation"
use scripting additions

set shell to "tell application 'System Events' to keystroke 'r' using {option down, command down}"
set shellQuote to quoted form of shell
log {"shell is:", shell}
log {"shellQuote is:", shellQuote}
--tell application "System Events" to keystroke "r" using {option down, command down}

** Notice that I had to use single quotes instead of double to create the shell string

When I run this the properties are:

Shell:    

tell application 'System Events' to keystroke 'r' using {option down, command down}    

shellQuote:    

'tell application '\''System Events'\'' to keystroke '\''r'\'' using {option down, command down}'

From the Script Dictionary for System Events on the Text Class:

quoted form A rendering of the text string suitable for handing to the shell as an argument to a command. The text string is wrapped in single quotation marks and internal quotation marks are escaped.

You also may want to try the System Events Command:

key code key code (verb)cause the target process to behave as if key codes were entered (from Processes Suite) COMMAND SYNTAX key code integer or list of integer ¬ using using or list of using PARAMETERS Parameter Required Type Description direct parameter required integer or list of integer The key code(s) to be sent. May be a list. using optional using or list of using modifiers with which the key codes are to be entered

technomorph's picture

I’m pretty sure you have to escape the double quotes and possibly the { and }

technomorph's picture

I think it might have something to do with quoting when using a shell script.

Check out https://macscripter.net/viewtopic.php?id=46949

You can probably find out what you need to escape and you’ll probably have to do it yourself.

You could use the AppleScript function they discuss “quoted form of”. Run it in AppleScript on the string. Then Log it or view the result in your editor.

technomorph's picture

Getting VuoCompositionMetadata from VuoRunner

Is there anyway to get VuoCompositionMetadata from a VuoRunner loaded with a URL?

I see in the VuoRunnerCocoa that the file is loaded as a String. Then the VuoRunner is initialized with the CompositionString rather than the fileURL.

I see the function to get the MetaData from the CompositionString. But is there anyway around this?

Or should I switch to using the CocoaMethod?

technomorph's picture

So this will get triggered every time It receives Feed Data? And will be complete once it’s done Amount items?

Pages