<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
		<id>http://www.wiki.movinglightassistant.com/wiki/index.php?action=history&amp;feed=atom&amp;title=RunAppleScript</id>
		<title>RunAppleScript - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.wiki.movinglightassistant.com/wiki/index.php?action=history&amp;feed=atom&amp;title=RunAppleScript"/>
		<link rel="alternate" type="text/html" href="http://www.wiki.movinglightassistant.com/wiki/index.php?title=RunAppleScript&amp;action=history"/>
		<updated>2026-07-26T04:12:51Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>http://www.wiki.movinglightassistant.com/wiki/index.php?title=RunAppleScript&amp;diff=166&amp;oldid=prev</id>
		<title>Andyv wiki admin: Page Added</title>
		<link rel="alternate" type="text/html" href="http://www.wiki.movinglightassistant.com/wiki/index.php?title=RunAppleScript&amp;diff=166&amp;oldid=prev"/>
				<updated>2017-11-12T09:09:22Z</updated>
		
		<summary type="html">&lt;p&gt;Page Added&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;===RunAppleScript( scriptString )===&lt;br /&gt;
:&amp;#039;&amp;#039;scriptString is a string. The string is the text of the script.&amp;#039;&amp;#039;&lt;br /&gt;
:&amp;#039;&amp;#039;No Return value&amp;#039;&amp;#039;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;THIS FUNCTION WILL ONLY WORK ON macOS.&amp;#039;&amp;#039;&amp;#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;This function is only available in MLA v1.3.1 Beta 7 onwards.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This function will run an Apple Script to allow control of the Finder and other applications. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Example..&amp;#039;&amp;#039;.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-- This script will bring Image Capture to the front and simulate pressing the space bar&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-- to capture an image from the tethered camera.&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;photoScript = &amp;quot;tell application \&amp;quot;Image Capture\&amp;quot;\n&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;photoScript = photoScript .. &amp;quot;activate\n&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;photoScript = photoScript .. &amp;quot;tell application \&amp;quot;System Events\&amp;quot;\n&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;photoScript = photoScript .. &amp;quot;key code 49\n&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;photoScript = photoScript .. &amp;quot;end tell\n&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;photoScript = photoScript .. &amp;quot;end tell\n&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RunAppleScript(photoScript)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;Wait(0.5)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-- We need MLA to be at the front to wait for image to arrive.&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;mlaScript = &amp;quot;tell application \&amp;quot;Moving Light Assistant\&amp;quot;\n&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;mlaScript = mlaScript .. &amp;quot;activate\n&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;mlaScript = mlaScript .. &amp;quot;end tell\n&amp;quot;&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;RunAppleScript(mlaScript)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;Wait(0.5)&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Note that any quote character needs to be &amp;#039;escaped&amp;#039;, i.e. &amp;lt;code&amp;gt;tell application &amp;quot;Image Capture&amp;quot;&amp;lt;/code&amp;gt; would need to have a &amp;#039;\&amp;#039; character before the quote to become &amp;lt;code&amp;gt;tell application \&amp;quot;Image Capture\&amp;quot;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Andyv wiki admin</name></author>	</entry>

	</feed>