Apple Script
I have been using the following apple Script in a home control program for the last 12 years and it has worked great
if (status of "Porch Lights, Front") is false and (daylight) is false then
turnon ("Porch Lights, Front") for 5 * minutes
end if
if (status of "Garage Lights") is false and (daylight) is false then
turnon ("Garage Lights") for 5 * minutes
end if
I just switched to another home contgrol program, Indigo and it won't run there, It gives me the following error.
Script Error embedded script: invalid syntax
Script Error around line 1 - "if (status of "Porch Lights, Front") is false and (daylight) is false then"
I wonder why it won't run now.
You need to open that application's dictionary and rewrite the script for compatibility. Some applications may not support more than a few basic AppleScript commands.
(70636)
Similar Messages
-
Sending email using apple script...
I have created a watch folder using apple script that when a file is dropped on it, it automatically opens, formats, and sends out a custom email.
What I don't understand is, how can I include multiple variables in the "content" section (also known as the body section of the email)? I want to put custom type in the content section that says "There is a file awaiting your review." I also would like to choose an email signature from my mail program to use. Third, I would like to include the name of the file that is being sent....
I found that by doing {content:iteminfo} I could get the file name...If I do {content:"There is a file awaiting your review."} I could get the custom type I wanted....
BUT, I can't figure out how to get BOTH of them together in ADDITION to adding a custom email signature...
I know there are some really smart people out there...Any tips?I can't figure out how to get BOTH of them together
This is just standard AppleScript text concatenation with the &:
... {content: "There is a file awaiting your review: " & iteminfo}
Here you can see I'm concatenating a literal string (enclosed in quotes) and a variable. You can extend this ad infinitum.
As for the signature:
tell theMessage to set message signature to signature "My Sig"
(which assumes you have a signature named 'My Sig'. Adjust as necessary. -
New to apple script...
Hi I am new to apple script; I was using Automator but it became too dumb to it's surroundings after a while. Can you please tell me why these don't do what I think they should; Safari has 2 windows open one with four tabs (window 1 as I have used exists to be sure of) and one with 9 (window 2).
tell application "Safari"
activate tab 6 of window 2
end tell
all it does is bring the frontmost safari window up
Please helpThere are a couple of reasons behind this, mostly because you're using the wrong command.
The main thing is that the 'activate' command is used to activate the application. Any other parameters (such as 'tab 6 of window 2') are discarded.
Instead, the appropriate syntax is to set the current tab property of the window:
tell application "Safari"
set current tab of window 2 to (tab 6 of window 2)
end tell
It's a little verbose, but it works.
If you also want to bring that window frontmost you need to change its index:
tell application "Safari"
tell window 2
set current tab to (tab 6 of window 2)
set index to 1
end tell
end tell
Note though that changing the window index will now also change this window to 'window 1' instead of 'window 2'. Something to bear in mind if you're taking further actions. -
How can I get the size of a file with apple script
I try to get the size of a file within an apple script. But I did not find information how to do this.
There are two ways. I think Apple is moving toward using System Events, which is listed first.tell application "Finder"
set myFile to selection as alias
--this just gets a file for me to work with
--coercing it into an alias is required for the other functions
end tell
tell application "System Events"
get size of myFile
end tell
set myInfo to (info for myFile)
get size of myInfo -
How to call a perl script from an apple script
Hi All,
How to Call a perl Script from an apple script.
Pls Give Your comments.
Thanx & Regards,
EstherApplescript to call a perl script named "/tmp/x.pl" passing an argument "world"
do shell script "/usr/bin/perl /tmp/x.pl world"
or if the script is given the executable atttribute (chmod +x /tmp/x.pl),
do shell script "/tmp/x.pl world"
Perl script "/tmp/x.pl" that prints a string using a passed argument
#!/usr/bin/perl
print "Hello $ARGV[$1]\n"; -
Hi Friends,
I am new to Indesign Scripting by Apple Script. As a beginner, I am trying to do some basic scripting in Indesign by Apple Script.
My aim is to disable the option of "Overprint [Black] Swatch at 100%" in Indesign. This option is available when we go to Indesign ---> Preferences----> Appearance of Black.
Also, if a user opens a file, in which the swatch is already enabled, then it should prompt him for disabling.
I can make a display dialog in AppleScript. But, I am bit unsure as how can I go ahead and disable this option. I tried this below script:
tell application "Adobe InDesign CS4"
tell every layout window to set overprint preview to false
end tell
However, it is changing the view option to overprint preview.
Appreciate your help and suggestions!
Thanks,
Abhishektell application "Adobe InDesign CS5"
tell the active document
set overprint black of document preferences to false
end tell
end tell -
Install and uninstall of dmg file using Apple script in Mac 10.6 and higher version.
Hi ,
Could anyone please help me to write a Apple script to Install dmg file and do clean uninstall in Mac 10.6.8 and higher version.
My requirement is:
When i run script : it has to install the dmg file which is located inside one desktop folder say 'New Folder'
I need to do clean unistall when i run the script: i need to delete the folder in ~/Library- locate folder say 'CPSPCSHOWSERVER'' move to trash and from Terminal type in command "rm -r ~/.CPS' to completely delte this folder.
Really appreciated all ur help!!
Thanks,
KT.http://macfidelity.de/2008/08/30/how-to-mount-a-dmg-from-terminal-in-mac-os-x/in dex.html
http://osxdaily.com/2011/12/17/mount-a-dmg-from-the-command-line-in-mac-os-x/
http://hints.macworld.com/article.php?story=20030614230204397
http://www.commandlinefu.com/commands/view/2031/install-an-mpkg-from-the-command -line-on-osx -
I use Adobe Photoshop CS4_Bridge _Photo Downloader to import images from CF Cards into my 11" Mac Book Air. I have an issue with the Text files
that seem to accompany each and every image that I do not need. How do I stop Apple Script (which I assume is the culprit in this case) from interferring with this process.Your iWeb Site is stored not on your iDisk, but on a file named Domain.sites in your ~/Home/Library/Application Support/iWeb/ Folder.
If , for whatever reason, you wipe your HD and/or lose this file (Get a new computer, Re-Install your OS, Stolen Laptop, Crashed HD, Etc.) without backing-up your Domain.sites file then you will have to re-build your iWeb sites from scratch again.
Of course you can edit your Published HTML files in a different program such as Dreamweaver or even Text Edit. You just can't edit Published HTML files in iWeb. Not at this time at least.
Use iWebBackup to backup your Domain file to a Blank CD or DVD. Backing up your Domain file to another folder on your computer is not fully backing it up. If your computer gets stolen you still lost the file but if you have your Domain file burned onto a CD you have a backup!
Download iWebBackup Here
You can use iWebExtender to automatically consolidate your files into one folder and delete multiple images.
http://iWebFAQ.com -
Can I use Apple Script to press a button?
Is there some way I can create an Apple Script to run and press a button in another application, or create a "plug-in" type script for the program to make the button into a something that can be used by a keyboard shortcut?
I ask because I have an application that I can use to operate my digital camera, however, the button that Auto-Focuses then Shoots a photo does not have a keyboard shortcut. This is a problem because I also have the App "Snatch" on my iPhone, and, long story, short, I discovered I could use Snatch on my laptop on an Ad-Hoc network from about 1,000 feet away, maybe more. If I could find a way of making the "AF and Shoot" button into a keyboard shortcut, or create a script that could be triggered by a keyboard shortcut to press the button, I could use Snatch to control my camera remotely, far better then any part I would by from Nikon, or a third-party (Trust me, I have used a lot of them, and this method beats them all, save for the fact that I can't use bulb.)
Anyway, thanks for any input, if any.Even if an application is not scriptable, you can generally use [GUI Scripting|http://www.macosxautomation.com/applescript/uiscripting/index.html] to press a button. For example, using Canon's RemoteCapture DC software, the script below will press the "Release" button of the main window:
tell application "RemoteCapture DC" to activate
tell application "System Events"
tell process "RemoteCapture DC"
click button 4 of window "RemoteCapture DC"
end tell
end tell
If you then put the above script in the AppleScript menu in the menu bar, you should be able to use a third party application, like Quicksilver, to assign a keyboard shortcut to it.
Message was edited by: Pierre L. -
How to check indesign version installed by Apple Script
Hi Friends,
I want to make an apple script which will check for the version of Indesign installed in the "Applications" folder.
I tried using "exists" function of Finder. But seems something is missing/incorrect.
tell application "Finder"
exists application file "Adobe InDesign CS4" of folder "Applications"
end tell
Please can you suggest.
Thanks,
AbhishekHi Niel,
Thanks for your email.
Basically, I need to check whether a user has which version of Indesign on his mac like (CS3, CS4 etc)
Accordingly, I have to create different loops.
I have CS4 installed on my mac but when I run the below
tell application "Finder"
exists version of application file "Adobe InDesign CS4" of folder "Applications" of startup disk
end tell
The result is false.. even though I have CS4 installed. And, if I try
get version of application "Adobe InDesign CS4"
It gives o/p as "6.0.6.622"
Thanks for your help!
Abhishek -
Hai all,
i am trying to insert footnote and its contents for a particular xml element in "Adobe Indesign cs2" thru apple script. But i'm facing some problem. I'm able to select the xml element and its contents and i can insert footnote for that element and i can cut that contents but i couldn't paste this contents in footnote. I have tried with the following code:
tell application "Adobe InDesign CS2"
tell active document
set theRoot to (item 1 of XML elements)
end tell
end tell
myLoopLoop(theRoot)
property myLoLoV : {}
property myHoHoV : {}
on myLoopLoop(myElement)
tell application "Adobe InDesign CS2"
tell active document
set moreElement to every XML element of myElement
repeat with x from 1 to (count of moreElement)
set em1 to item x of moreElement
select em1
if (name of markup tag of em1 is "informalexample") then
set em2 to em1
select text of em2
tell insertion point 1 of em1
set myfootnote to make footnote
end tell
tell application "Adobe InDesign CS2"
set myselection to selection
cut (selection of active document)
end tell
tell application "Adobe InDesign CS2"
tell insertion point 1 of myfootnote
paste into myfootnote
set text of em2 to myfootnote
end tell
end tell
end if
tell me to myLoopLoop(item x of moreElement)
end repeat
end tell
end tell
end myLoopLoop
Can anyone help me out to sort this problem?
Thanks
anbu
I Mac Mac OS X (10.4.8) Intel based Machi all
any help
thanks
anbu -
Using c++ variable in apple script
Hi all,
I am just calling the apple script from my indesign plugin.
I need to pass the c++ variable to apple script for opening a file
This in my apple Script which i have embedded in c++ code
tell application "TextEdit"
activate
open "Users:User1:Library:Preferences:Adobe Indesign:Version 5.0:MathEQ.txt"
end tell
The filepath "Users:User1:Library:Preferences:Adobe Indesign:Version 5.0:MathEQ.txt" is stored in the C++ variable char* textFileName.
I need to use the variable textFileName in apple script which has the path.
How to go about it?
Thanks
SakthiI have a similar problem trying to get data from any field into an AppleScript variable.
Something like *set phoneNumber to cell "Phone Number" of current record* works fine if you are using the script from a layout that has this field on it.
But I have a lot of fields on different layouts and I want to have access to all fields in the table, no matter what layout they are on, or what layout is currently active.
And I want to do this without having to specify on what layout each field is located.
In the past (FileMaker 6) I used something like *set phoneNumber to (cell "Phone Number" of current record of database 1)* but this is no longer working in FileMaker 9.
So I was thinking to use something like *set phoneNumber to cell "Phone Number" of current record of table "Table Name"* but that doesn't seem to work.
The only thing that seems to work is *set phoneNumber to cell "Phone Number" of current record of layout "Layout Name"* but as I said, I don't want to specify the layout for each field.
Any ideas anyone?
Message was edited by: khasmir -
Find raster Image & Vector image in adobe indesign using apple script?
Find raster Image & Vector image in adobe indesign using apple script?
Find raster Image & Vector image in adobe indesign using apple script?
-
XML Comment in Indesign using Apple script.
Hi all,
How to find the selected XML element is commented in indesign and get XML comment value in thru apple script. Any Ideas?
-JacinthaYou can have as many comments as you want so they require you to state the index of the comment in your reference.
Assuming you have an object reference for the XML element, you would replace "associated XML element of selection" with that.
tell application "Adobe InDesign CS3"
set myComments to {}
if every XML comment of associated XML element of selection is not {} then
set end of myComments to value of every XML comment of associated XML element of selection
end if
return myComments
end tell
if you know there's only going to be one comment then,
tell application "Adobe InDesign CS3"
if every XML comment of associated XML element of selection is not {} then
set myComment to value of XML comment 1 of associated XML element of selection
end if
return myComment
end tell
~Mike -
Automator or Apple Script To Move Multiple Files to Multiple Folders
I was just wondering, is there any sort of automator workflow or maybe apple script that will allow me to automate the following:
I have a folder named SCANS containing multiple different files that need to go to multiple different folders.
So Say I have:
SCANS
and in this folder I have ten files named A,B,C,D,E,F,G,H,I,J and I want each of these files to be moved to different folders eg.
A I want to go to folder 1
B I want to go to folder 2
C I want to go to folder 3 etc etc.
Anyone know if there is a way of doing this please?
I have tried a workflow where I find finder items in the Scans folder and move to another but that only seems to work for one file. When I add more it does not seem to work.
Any help/guidance would be appreciated.
Thank you!Hi Niel,
Not quite what I wanted because I missed some information from my question....
What I actually want is to search for files containing certain text in the name and if positive to then move that file to the specified folders.
Cheers. -
Apple script for 10.4 - works in OSX but not older
Hi I have a script which I'm using on my current system 10.9 it runs in excel and it goes something like this:
tell application "Microsoft Excel"
-- put the complete set of data into a list of lists (i.e., 2 dimensions -> columns of rows)
tell active sheet to set myData to value of used range
-- recipient email
set myRow1 to 1
set myCol1 to 1
set Address to item {myCol1} of item {myRow1} of myData
-- recipient name
set myCol4 to 4
set rName to item {myCol4} of item {myRow1} of myData
The above is just a small snippet from the script. However I try running this on apple 10.4 apple script and it does not work. I'm trying to save my computer time from have to this minimal task on an older mac I have but I'm experiencing some problems. Does the active sheet not work in apple mac 10.4? What am I missing? Any help would be greatly appreciated.Hi Ohms238,
I found this Apple developer page that talks about changes made in each version of OSX. It will require some work, but you can go through and see what changes are relevant to your script.
But I would actually recommend running pieces of your code separately to see exactly what parts don't work and then rewrite just those portions.
Maybe you are looking for
-
Calculation based on two result columns in combined report
Hi all - I have a combined analysis and I need to add a result column based on two of my result columns. The calculation involves one column from my first report and one column from my second report. The first report has # of opportunities and my sec
-
At the end of the installation process (Clean install, new 500GB internal hard drive, formatted and partitioned, MacBook 13" Aluminum, late 2008) the progress bar stalls and eventually a drop down error message appears "Can't download the additional
-
BI OnDemand with SAP B1 Online Database
Hi Experts, Can BI OnDemand [(bi.ondemand.com) |bi.ondemand.com] work on SAP B1 Online Database (OLTP Database) and even on multiple database? if yes then how?
-
IDOCs - IDOC type ORDERS05 with message type MSGCHG
Hi, I'm in my first IDOC project and I'm facing a problem. I need to change sales orders with EDI messages, so I've decided to use message type ORDCHG and IDOC type ORDERS05. I'm filling segments E1EDK01, E1EDP01 and E1EDP19. In header the action is
-
Hi all, please tell the use of GRWR condition type and in which case this is used and for what purpose regards Komal