0
votes
1answer
20 views

Creating a script that will execute a program and if it exits without crashing, will run it again

I've already asked this question in the UNIx exchange but I was told to ask here also about AppleScripts if the standard shell does not work. I require a script that will open an application. Wait ...
1
vote
1answer
80 views

ffmpeg working from command line in Terminal but not in an Automator shell script!

I have just compiled my own copy of ffmpeg on my system and it's located in the following path: /opt/local/bin/ffmpeg When I run the following command in Terminal.app, it runs smooth: ffmpeg -i ...
2
votes
4answers
301 views

How to open a new Terminal tab in current working directory?

I want to create and run a bash function that: cd into a project's directory Open a new tab in Terminal in the same directory Open my dev tools and start dev services Item #2 doesn't work as ...
2
votes
1answer
107 views

Trim filenames in automator w. shell or applescript

Why doesn't this work? (The automator is in swedish but the parts are: get selected finder objects - get folder contents - run shell script) I want to trim the first three characters of the ...
1
vote
1answer
82 views

Script to check Software Version

Hi i'm tryin to write a script to check software version. I want to pass my own variables, which are name of the Application and Version. Here's a copy. It's not working for me currently... i'm a ...
1
vote
2answers
664 views

What is the Mac equivalent of Windows “start” command?

I'm creating a script that runs several other scripts. I need them to all start up in their own process (read window) so I can review the output of each, but I also need them to run in parallel, so ...
0
votes
1answer
39 views

How to script a logout while screen is locked?

I want to log out a user via a shell script, after a delay. However, there's a few other issues: User does not have admin and/or root. Logout must complete even if screen is locked. Currently, I'm ...
3
votes
1answer
106 views

Apps using significant energy terminal/applescript

Does anyone know how to access the "Energy Impact" data used to determine "Apps Using Significant Energy" displayed in the battery menu bar? I'd like to use it in a shell-script/applescript.
2
votes
2answers
193 views

Terminal.app equivalent of `xterm -e 'cmd'`

With xterm (and gnome-terminal, terminator, etc), you can run the following command: $ xterm -e 'vim somefile.txt' xterm will open and run the specified program (in this case, Vim). When the ...
2
votes
5answers
354 views

Set Services keyboard shortcut via script OSX

I need a way to set the following programmatically: Specifically for shortcuts under Services, if that makes a difference. I'm wondering if this is possible via shell or AppleScript? EDIT: I've ...
2
votes
2answers
117 views

How do I link/call an actual shell script saved within an Applescript app?

What's the correct syntax in the Applescript below to make this app run by double clicking on it rather than how it runs now by just running the Applescript in the AS script editor? The Shell script ...
1
vote
2answers
1k views

User input assigned to variable in AppleScript then passed to “do shell script” command

How do I grab input from the user in AppleScript and then pass the result of the variable to a do shell script command from within AppleScript itself? For example, the user would type the answer foo ...
6
votes
2answers
5k views

Run AppleScript from bash script

If I wanted to run an AppleScript from within a bash script I could call a file with the list of commands that I require to execute. #!/bin/bash {some commands} osascript file.scpt {other commands} ...
0
votes
1answer
119 views

Set environment variable for the process before startup [duplicate]

I have the following situation: I have Mac OS bundle with application which uses some 3rd party dylib's and those dylib's depend on some env variable, let's name it ENV_VAR. I want to set ENV_VAR to ...
0
votes
1answer
155 views

Script to Update/download most recent iTunes podcast WITHOUT opening iTunes at all?

I have a couple favorite podcasts that I subscribe to in iTunes. I'm using You Control (so I don't have to open iTunes to play my music). I'm using Keyboard Maestro. I've made a macro that runs ...
2
votes
2answers
390 views

How can I reproduce the Finder sort order without asking Finder to sort for me?

I work with a large collection of mostly-text files subdivided by series, periodically mirroring them from an upstream repository and repackaging them using a shell script from a slightly chaotic ...
1
vote
2answers
2k views

Change Date Created based on the filename

I've downloaded a bunch of my Instagram images but the Date Created of the files is set to the time that I initiated the download. What I do have though is the Date Created in the filename. What I ...
0
votes
2answers
370 views

How to get the path of the selected Image in Adobe Bridge via Applescript?

I am trying to get the parent file path of a selected image thumbnail in Adobe Bridge CS5.1 to pass it on to a shell script. An Applescript wraps a tiny javascript command in command like this: set ...
54
votes
4answers
24k views

How can I trigger a Notification Center notification from an AppleScript or shell script?

I'd love to be able to take advantage of 10.8's Notification Center features in AppleScripts and shell scripts I write. Is there a built-in command or a third-party library I can use from either an ...
2
votes
3answers
475 views

How can I see how long my computer has been active (as in not idle)

I've seen a variety of solutions to check how long my machine has been idle, and I know I can check how long since last reboot with uptime, but I'm curious if there's a way to see how long since my ...
1
vote
2answers
2k views

How do I run an OS X command script on remote Xserves from a desktop OS X script?

The answer to an earlier question, Access and control home office network, iMacs, and Xserves, left me with a new problem. To review, I have a computing environment comprised of: 27" iMac with dual ...
2
votes
3answers
4k views

/bin/sh: rm: command not found

I have problems with some applications that use AppleScript shell script feature. For example, Growl's uninstall scripts shows an error: error "/bin/sh: rm: command not found" number 127 The source ...
1
vote
2answers
2k views

How do I write an AppleScript which auto reconnects to Wi-Fi?

Sometimes I need to download very big files from the internet using torrents (I'm using Transmission) and the Wi-Fi always drops. I bought several routers and modems and none of them work. I've been ...
1
vote
3answers
621 views

Make a screen-shot and upload with a script

I am not very good with AppleScript but I would imagine this is something quite easy for the AppleScript guru out there, I am looking to make a screenshot of a region like with doing Apple-Shift-s and ...
2
votes
5answers
6k views

How can I write a script to open multiple terminal tabs and execute code in them?

I want to be able to open the terminal application and have it either automatically run a script that opens several tabs and run an arbitrary set of commands in each. For example I would like one tab ...
1
vote
1answer
732 views

AppleScript app started prompting to run or quit. How can I disable this?

I'm not entirely sure why this has started happening since this is completely new behaviour and I haven't done any system updates but I have a nice little toolbar app for my Snow Leopard Finder.app ...
2
votes
3answers
909 views

Check if a process is running, if not execute it again in Terminal

Is there a way to periodically check if a process is running with (probably with Apple script, or some other shell script) and if not then to execute it in Terminal? I have a PHP script that is needs ...