OS X V10.7 Lion :: Make Applescript Open More Than One Program At Once?
Jun 23, 2012
I made the code below to use together with another 2 codes. One that mounts a samba share and another that runs rsync with specific parameters. The script below runs after rsync complete its task.
The 3 codes me to test my HTML/CSS/PHP/Javascript code changes.This code works but I have to repeat it to each browser/app I want and a 10 lines script becomes 40 lines (Google Chrome, Firefox, Opera and Safari). Is there a more elegant way to do that? I've tried to use an array/list but didn't work.Â
if application "Safari" is running then   tell application "Safari" activate   end tell   tell application "System Events" tell process "Safari"  keystroke "r" using {command down} end tell   end tellend if
I'm using a PC with Windows XP. I'm a private developer. I've written a project in Java and wish to deploy it to other people using email. I've written an Install program (the Main-Class) and successfully packed this in a jar file with the project class files and some data files all as described in the deployment trail in the Java Tutorials. A recipient with a Mac with OS X downloads the jar file and runs it to install the project class files and some data files. The install program then writes an Applescript file (Vocab.scpt shown below) on the Desktop to make starting my downloaded program easier but it doesn't seem to work and I think it may be because the script file is not "executable". Could this be the case? If so, how could I change my install program to make the script file executable or alternatively use some other system to start the downloaded program?
Vocab.scpt:-
# Script to start: Vocab Version: 1.0.0
do shell script "cd /Applications/Vocab; Java Vocab"
Unfortunately I don't have a Mac to experiment with this problem and although I have spent some days on and off trying to find an answer in the mass of information available on Apple's website I can only find small clues here and there to answer my problem (which I would have thought was quite a common one). In Windows a batch file (eg. Vocab.bat) is automatically executable.
So I downloaded the wrong Airplane Mode program for my operating system and I now have AppleScript Error message. It will not allow me to quit the program. Also, once that happens how do I remove the program from the computer?
Having this camera on my Mac, I am wondering if there is a program or reliable app that will make it into a video camera. I wanted to see if anyone enters my room at night while I am at work. Is there a program or app out there, one that is reliable?
Info: iMac (27-inch, Late 2013), OS X Mavericks (10.9.4)
if it is possible to open a specific file or program by mapping a keyboard shortcut. Â For example, FN-F1 could open "ABC.DOC" or FN-F2 could open Excel.
Is anything like this possible, either within Mac OS X (10.7.4) or with a third party program?Â
is it possible to take a program made from a PC and make it run on a mac? without crossover (it never works)its not a complex program but it never works from me
When opening a Mail message with any sort of scripting, many of the menu items remain greyed out, including the one that's important to me, 'Save Attachments...'.Â
If I manually open the same message, the menu items are enabled.Â
Try this script, by resetting the mailbox name to one of your own mailboxes, and you'll see what I mean.Â
(I've lodged a bug report).Â
Regards set SaveAttachmentsMenu to truetell application "Mail" activate set WindowCount to count of windows open item 1 of messages of drafts mailbox set x to 0 repeat # wait until the message is really open. tell current application to delay 0.1 set x to x + 1 if x > 40 then exit repeat if (count of windows) > WindowCount then exit repeat end repeat tell application "System Events" to tell process "Mail" select window 1 tell current application to delay 0.2 if exists menu item "Save Attachments…" of menu 1 of menu bar item "File" of menu bar 1 then keystroke "a" using command down if not enabled of menu item "Save Attachments…" of menu 1 of menu bar item "File" of menu bar 1 then say "attachments disabled" click menu item "Select All" of menu 1 of menu bar item "Edit" of menu bar 1 set x to 0 try click menu item "Save Attachments…" of menu 1 of menu bar item "File" of menu bar 1 end try repeat until exists sheet 1 of window 1 tell current application to delay 0.1 set x to x + 1 if x = 40 then set SaveAttachmentsMenu to false exit repeat end if end repeat end if end tellend tellSaveAttachmentsMenu
Info: iMac, OS X Yosemite (10.10), Late 2014 i7 iMac, Epson 730, FX C1110
When I open a new Finder window, it shows "all my files".Then I click on my home in the sidebar.Then Finder shows my home, but *always* in list view.I open View Options, and check "Always open in icon view". But some time later, when I go to my home in some Finder window, it shows my home in list view again.I haven't found a pattern yet, unfortunately.
I launched Mail as I ordinarily do. It opened up, but the header bar was grayed out. Finally I managed to open program via Message/Go To/ Inbox, but no messages appeared in any of my mailboxes (even though I had several still in there from today). Nothing is happening, I even can't quit teh mail program.
I've been trying several different methods to download a file through Applescript. I've looked at different sites/discussions and I've tried to use curl, wget, and some other ways, however I still can't get it to download the file. It'll either just not download, or no URL specified. [code]
I installed a droploet into Finder, now I can't get rid of it. Scoured the internet and no one says how to remove them, only add them. What's the method for getting rid of them?
I'm trying to install Rosetta Stone but keep getting the message that a "newer version of the program already exists on this computer". I cannot find any sign of this.
I need to have 2 copies of Mozilla Firefox with abolutely separate settings on my iMac.Â
On my previous PC I had 2 portable copies of FIrefox from portableapps.com Can something like that be performed on iMac? Â
Why: sometimes I need to use a US proxy setiings in brouser (to purchase @ US stores that block foreign IPs). On the other hand I have my main everyday Firefox set up for my everyday needs. Switching settings is quite annoying. I just had a separate copy of FF on my PC for use with US proxe settings before i moved to iMac.
How do I make "RAR expander" my default program for .rar files?Or is there another program you would recommend?
Background:I used "RAR expander" for a long time until I came across a file it was not compatible with. I then downloaded and installed "The Unarchiver" and it worked on the file "RAR expander" would not open.
After that "The Unarchiver" became the default program for .rar files. The problem is that "The Unarchiver" does not work well with password protected files. So for months now I have just manually opened "RAR expander" whenever I try to open a password protected file.
I want to keep both programs so I will be able to open any file, but as I rarely use "The Unarchiver" I would like to have that be the one I have to dig through sub-folders to use. That is, unless there is some excellent program I have not tried.
I have a large dataset in Excel that I have to do a multiple find/replace in (changing USPS state abbreviations to their full names). In searching the Microsoft boards--I was directed to use Applescript, and even the documented help with Excel was recommeding this. Unfortunately, there wasn't much help potinting me in the specific direction I needed.
How would I convert a string like 12:34 to an Applescript timestamp? I'd like to be able to add/subtract minutes to/from such items; i.e., to be able to use 12:34 + 6 minutes, for example.
Info: iMac, OS X Mountain Lion (10.8.5), iMac 24" 2.8 ghz 4 GB RAM
Here is the error message whenever I open up a X86 program. What I did was I've installed Xcode 3 and CUPS 1.4.5, after the restart, it started to appear this message. I don't have Time Machine. And also I've tried to uninstall Xcode but still doesn't work.
Is there a way to have a program open at login (I know, I know, select "open at login") but then NOT appear in the dock when it's open? I'd like to have my Garmin software always open but hate the cluttered space of having it open. I can always close it with Cmd+tab. I'm running Leopard 10.5.6.
I have a mail attachement with the extension .gem, and I would like to use that attachment as the argument to a java .jar program. I've figured out how to start the java program using a shell script like this: #!/bin/bash java -jar /Users/geoff/Programs/program.jar $1 If I name this script program.sh and change the permissions to allow execution, I can successfully run the program by typing this in a terminal window: ./program.sh filename.gem
However, when I try to open the attachement filename.gem from mail, it won't let me use program.sh to open the attachment. The OS seems to make a distinction between a file and an application that is independent of the execute permission on the file. After doing some reading about this, I tried Automator. One of the Automator actions is to execute a shell script, so I added that action to my Automator project and typed in my command: java -jar /Users/geoff/Programs/program.jar $1
I also changed to input from options from "stdin" to "argument". I then saved the Automator project, and was able to associate that project with the .gem file attachment from mail. The java program started, but behaved as if the $1 argument was not included. (Perhaps I just need to leave out the "$1" in my Automator command, trusting Automator to insert the argument in the proper place. If that theory is correct, my program is interpreting the text "$1" as an argument, which would be consistent with the behavior that I'm seeing.) I've seen other suggestions to use AppleScript, but it seems to me that there ought to be some simple way to do this. (I just got a Mac, by the way. I was able to do this in Windows using MIME type definitions and a .bat file. The difference is that Windows allowed me to consider program.bat as an executable, but Mac OS doesn't consider program.sh to be an executable.)
I just downloaded the iTunes 10.6 update and now my iTunes will not open. The icon in my dock will jump a few times, as if the program were opening, but then nothing happens.
I have some movies on MKV files that work on a MKV program that I have but every time I open the file it opens a file file converter program that I have. Is there a way to make it so all of the mkv files open in the mkv program without left clicking on each one and setting it to open in the MKV program each time?
Info: Mac Pro, OS X Mavericks (10.9.2), 32gb of ram