applescript

List all applications - output as text file

Hello, I was just wondering how someone would go about finding all the applications that are installed on Mac OS X 10.5 using preferably applescript and output all their application names to a text file. ...

iTunes Application Loader - automation

Since recently Apple changed the iTunes Connect interface, and people are required to upload apps with the Application Loader. That's nice but I need a script for automating my work. How can an app like App Loader be automated? I was thinking of something written in AppleScript ... but I don't know what actions it exposes (if any). Fo...

Sort lines by length with automator?

I have a text document (1MB, TXT file) with a little more than 17,500 lines. What I'm hoping to be able to do is to sort those lines by character length and have it output to either the same file (which is then saved) or a new file entirely. Either one works fine as long as I know ahead of time. Bonus points if I could do it through Aut...

AppleScript Droplet on DMG not working.

Hey I have the following AppleScript saved as a Droplet. It is saved on a DMG file like this one http://dl.dropbox.com/u/1839051/TestDMG.dmg The Problem is, while some can drag the template onto the Droplet and have it working, when I try to drag the template onto the droplet the crossed-out circle-symbol shows up indicating that this a...

How can I open a new email using AppleScript, setting "To:", "Subject:", and attaching a file?

To help my users report problems easily, I want to create as much of an email as possible. Most importantly, I want to attach a file (the log file). How can I do this in AppleScript? ...

How to reference a file on users desktop with Applescript

Hello, I'm pretty new to Applescript and am trying to reference a file on the currently logged-on user's desktop, but I don't know how. In POSIX you'd use the tilde character to specify the user's home folder, but that doesn't seem to work in applescript. I've read other posts about how "desktop" is already defined as a keyword applescr...

Applescript testing for file exist

OK, I thought this would be a simple one, but apparently I'm missing something obvious. My code is as follows: set fileTarget to ((path to desktop folder) & "file$") as string if file fileTarget exists then display dialog "it exists" else display dialog "it does not exist" end if Easy right? Unfortunately, when I run the scri...

Simple GUI scripting question

Hi all, I am trying this simple GUI script to open a new window of Safari: tell application "Safari" activate end tell tell application "System Events" tell process "Safari" try tell menu bar 1 tell menu bar item 3 click menu item 1 end tell en...

Delete an Image in iPhoto having the Filename (incl. path)

How I can delete an image (move it into the trash) from applescript by giving the filename and path of the image locate on the drive. This script will be started from the shell and may get the (valid) filename including the path (size or other properties if needed) as parameter. So far I could manage to select the image by name (which ...

AppleScripting an edit to computers' info in ARD

So there's this weird behavior in Apple Remote Desktop where computers will report self-assigned IPs back to the console before they've gotten their real IPs from the DHCP server, and then since ARD contacts computers based on this IP address, they become "lost," in a manner of speaking. I can fix this by wiping out the 169.x.x.x address...

How do I open a folder in Textmate with Applescript?

So I've opened Textmate using Applescript, how do I tell it to open a specific folder? EDIT: Tried Josh K's suggestion, but a strange error occurs. I ran this line: do script "mate rails_projects/newproject" And here is the result: bens-macbook-pro:~ ben$ mate rails_projects/newproject mate: failed to establish connection with TextM...

AppleScript: I copied the Finder selection to the clipboard. Can I get the full path to the copied items?

I have one or many files and/or folders selected in the Finder. I manually copy them to the clipboard/pasteboard (⌘C). To keep things simple, let's say I just copied one single normal file. The ideal solution, however, would deal with many files and a mixed selection with folders, aliases. Now that this file is on the clipboard, I want...

AppleScript: Finder: How can I tell if the Desktop has focus?

window of the desktop is rather crippled. Can't get its index. Finder windows does not include the desktop window, so I can't check that the it's the first there. index of the first Finder window is 1 regardless of the desktop having focus. (as long as other Finder windows exist, otherwise it'll fail.) ...

How to run an AppleScript from within a Python script?

The questions says it all.. (On a Mac obviously) ...

Get the results from pbcopy to transform them to an array with applescript?

I have the following code to read contents from a file to open multiple Safari browsers. set locations to paragraphs of (read (choose file with prompt "Pick text file containing urls")) repeat with aLocation in locations tell application "Safari" to open location aLocation end repeat How can I read contents from pbcopy (copied res...

How to pass a variable FROM applescript TO a shell script ?

I have the following script #!/bin/bash /usr/bin/osascript << EOT set myfile to choose file EOT no_ext=$(python -c "print '$myfile'.split('.')[0]") ### this works - just need to know how to pass the arg R CMD Sweave no_ext.Rnw pdflatex no_ext.tex open no_ext.pdf Can anyone point me to "how to pass the variable myfile corre...

Applescript Xcode to clean, build and install on iPhone device

Hi, I'm trying to applescript XCode into building and launching on device. My script is as follows: tell application "Xcode" open "tmp:iphone:Guidepal:Guidepal.xcodeproj" tell project "Guidepal" clean build launch end tell end tell My project consists of two targets, MainTarget and a SideTarget, th...

AppleScript UI-scripting - conditional

I want to click a radio-button in System Preferences if another radio-button is selected, like this: tell application "System Preferences" activate end tell tell application "System Events" tell process "System Preferences" click menu item "Mouse" of menu "View" of menu bar 1 if radio button "Right" is selected <-- pse...

How do I launch a particular version of Xcode from Applescript?

I have two versions of Xcode installed, Xcode 3.2.3 and the Xcode4 developer preview. How do I ensure from Applescript that the 3.2.3 version is picked? ...

How to create an excel chart using py-appscript?

Hey! I am using Excel 2011 v14 and trying to dynamically create a chart based on the selected range on my worksheet. To select a range, I use the following code segment: xl = app('Microsoft Excel') tcell = 'B' qcell = 'C' for r in xrange(2, 16): xl.cells[tcell + str(r)].value.set(r) xl.cells[qcell + str(r)].value.set(random.ra...