Vocal command:how Apple script ?
Hello, i'm new and i've got a question about Apple Script.
I want to use the Vocal Recognition for my app, is it possible?
For example, i say to my computer "open safari and search to google "APPLE"" end the computer do that.
I know that there is a similar program on the Preferences but i wan't to do another app to learn how to use the apple script.
Thank you, bye!
Try this
-- Script Start
set answer to text returned of (display dialog "Press the function key twice and talk" default answer "" buttons {"OK"} default button 1)
if answer contains "open safari" and answer contains "google" then
set search to text ((offset of "google" in answer) + 6) thru -1 of answer
tell application "Safari"
open location "https://www.google.com/search?q=" & search & "&oq=" & search & "&aqs=chrome..69i57j0l5.1526j0j1&sourceid=chrome&espv=210&es_sm=91&ie=UTF-8/"
end tell
end if
-- Script End
Hopt this helps
Similar Messages
-
Sudo command in apple script? Encrypting apple script?
Hi,
1. I need a way to enter my root user password in applescript (when you run sudo in terminal you are prompted for a password, this is not so in apple script. So how do you tell apple script what the password is?)
2. Can i encrypt my applescript with a password so that only i can open it?
Thanks,
Patrick.# 2 works great, #1 not so much... ive been trying
tell application "Terminal"
do shell script "su"
end script
any way i can auto enter my password following "do ....Su"? -
Home directory command in apple script
Hi,
i have written an applescript where i want to save a file after writing into it to some user folder. For example: i create a file "temp.jpg" and want to save it at location : "/Users/<username>/Library/Foldername/abc.jpg".But the problem is that i am using hardcoded stuff i.e. "/Users/<username>" but i need it to be automatically taken and i have tried for "~/Library/Foldername/abc.jpg" but applescript doesnt expand the tilde.Is there some other way of getting the home directory path as i think "~" is used on shell scripting only.
Thanks..Here:
(path to home folder as string) & "Library:Foldername:abc.jpg"
(20892) -
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 -
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 -
How to turn off Bluetooth adapter via command line or script?
I'm trying to write a batch script that will be able to turn on/off any connected Bluetooth adapters.
In the "Bluetooth Settings" window, how can I change the "Turn off Bluetooth adapter" setting via command line or script?
Due to my account not being verified yet, I cannot post a screenshot. I will update this thread as soon as my account is verified.get-service -DisplayName 'Bluetooth Support Service' | Stop-Service
¯\_(ツ)_/¯ -
How do I install and apple script in mail
I am using dreamhost as my ISP. I am getting killed with spam and the have a script. I found out how to add the script via the rules function, but, how do you store the script in the location you need to retreive it from. there I can't find info. Can someone give me steps please? Do you make a text file, etc?
Select Mail Help from Mail's Help menu. Search for "install apple script."
Use scripts as rule actions
You can attach a script to a Mail rule. For example, you could have an incoming message trigger a script that copies information from the message and pastes it into a database that works with AppleScript.
Open Mail
Choose Mail > Preferences, then click Rules.
Add a rule or select an existing rule to edit.
Choose Run AppleScript from the “Perform the following actions” pop-up menu.
Choose a script from the pop-up menu of scripts that are located in ~/Library/Application Scripts/com.apple.mail. Or choose “Open in Finder” to open the folder so you can copy a script into it.If you later move or rename the script, your rule will not work.
Click OK to save the rule.
If you used scripts in Mail rules in OS X Lion or earlier, then the first time you open Mail in OS X Mountain Lion or later, your scripts are moved to ~/Library/Application Scripts/com.apple.mail, and your rules are updated with the new location. To show your home Library folder, hold down the Option key, then in Finder choose Go > Library.
If you use iCloud Documents & Data, your rules are available on your other Mac computers (with OS X 10.8 or later) that have iCloud Documents & Data turned on. Scripts attached to rules aren’t available. -
How do I download apple script support
How do I get Apple Script Support Download for ITUNES on windows 7
AppleScript is a Mac OS X technlogy only. You cannot get AppleScript support on a Windows system. Depending on what it is you wish to accomplish, though, there may be other ways. See:
http://dougscripts.com/itunes/itinfo/windowshelp.php
Regards. -
How to call a HP-UX command or shell script from Forms 4.5
Does anybody know how to call a unix command or shell script to get a files list of HP-UX server from Oracle Forms 4.5 on client side? I tried to use DBMS_PIPE package to get it done but I failed. Please let me have the solution if anybody knows how. Very urgent!
I tried the host command before and it just let me shell to the DOS environment but not HP-UX environment as Forms was running on Windows platform. So, I could not run a unix command or a shell script. Is DBMS_PIPE the only way to get it done?
-
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 -
Apple Script command on background image
Hello,
So the thing is.
I want to creat this apple script that would react only when i switch to a certain space.
I searched in the interent and found out that the Mac has no easy way of finding out, on which space it is on, so my questions is.
Would it know what background image is on that space, so that if I changed to a certain space, it would recognise the background image file, and run my script.
I have just thought of this my self, so I will be testing too.
But I wanted to know if anyone one els out there has thought of it first and found an answer.
Thank youPlease consider submitting an enhancement request to Apple, requesting that information on the spaces be made available to applications and scripts.
-
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 -
Selecting Different Printer With Apple Script.
Hi,
I am currently in the process of making a script to be able to print off labels without the need of much user input (read from a document or e-mail) and I want to be able to set the printer when it goes to the print screen.
this is the final apple script step in the application cmd+p brings up the 1st print menu the return takes it to the second print menu cmd+v pastes predifind by the user the ammount of copys they want
on run {input, parameters}
tell application "Labels & Addresses"
activate
tell application "System Events"
keystroke "p" using command down
delay 1
keystroke return
delay 1
keystroke "v" using command down
delay 1
tell application "System Events"
tell process "Labels & Addresses"
click (menu item whose description is "Printer")
click (menu item "Zebra Technologies ZTC GK420t" whose description is "Printer")
end tell
end tell
return input
end tell
end tell
end run
now there is chance to change the printer selection twice once in the 1st print screen and once in the 2nd print screen the only problem is im not sure how to apple script to select the right printer from the drop down menu, I got the code from a forum but I think it was old code as when I tested it it was returning errors so I modified it a bit and now it just struggles finding the menu item with description of printer.
Does anyone know what I would have to use for it to select the right printer? (The Zebra Technologies ZTC GK420t)
Help would be greatly appricited!
Thanks,
Bruce
P.S. sorry the code is a bit messy!Im NOT sure if you have just made this a little over complicated… This works just fine for me. Tested with about a dozen psd layers…
tell application "Adobe InDesign CS2"
tell active document
tell rectangle 1
tell graphic 1
tell graphic layer options
set GLC to count of graphic layers
repeat with i from 1 to GLC
if name of graphic layer i ≠ "Blue" then
set current visibility of graphic layer i to false
else
set current visibility of graphic layer i to true
end if
end repeat
end tell
end tell
end tell
end tell
end tell
This variant also works as I would have expected too… Retaining visibility from a list…
tell application "Adobe InDesign CS2"
tell active document
tell rectangle 1
tell graphic 1
tell graphic layer options
set On_List to {"Red", "Aqua", "Orange"}
set GLC to count of graphic layers
repeat with i from 1 to GLC
if name of graphic layer i is not in On_List then
set current visibility of graphic layer i to false
else
set current visibility of graphic layer i to true
end if
end repeat
end tell
end tell
end tell
end tell
end tell
Maybe you are looking for
-
Ical 5. Events not displaying
Morning. So, Lion is in. Was adding events to Ical5 the other day, and all was going well. These are all normal full day events, that are non re-occuring, and all on my mobileme calendar. (I do have a valid mobile me account and such as well) Made it
-
Video adapter was fine, now just grayscale
Hello, For about 6 months, I was using the following setup: an M9109G/A video adapter, a RadioShack RF Modulator, an Acoustic Research video cable, an old Quasar 24" TV and a 1.42GHz eMac. This setup was a relatively cheap alternative to buying a pro
-
Receiving "Connect to iTunes error" message when trying to purchase gems in Kingdoms of Camelot game app even though I was able to do so earlier today.
-
Quicktime and all quicktime application crash, can't uninstall QT too
hi all. I have an application (called Omnia Maxi) that use an old version of QuickTime (4.something). I have installed that application togheter with the version of QuickTime that comes with it (4.x). I already had the last QuickTime version (7.62.14
-
If I have a Windows server installing ACS 4.2, and I have another server for only failover purpose. Can I use the same license in the failover server, or I need to buy another license? Thanks