applescript

Webkit/Safari/Firefox/API: Can I programmatically read/extract multiple tabs' URLs?

Topic: Programmatically manipulate web browser in OS X 10.4.x+ Tiger/Leopard. Subjects: Webkit, Safari, Firefox, APIs, Applescript, Automator, Javascript, Ruby, Ruby on Rails, OS X, Tiger Goal: Collect/Read/Extract URLs from Safari into text (Ruby on Rails code) file. Note: A solution that uses FF would be very appreciated, too. I use Sa...

How do I open a Finder sidebar folder via AppleScript?

I have a bash script which will be run on a Mac via ssh. The script requires a particular network drive to already be mounted. On the Mac, I mount this drive by opening a folder "JPLemme" on that drive in Finder. This mounts the drive until the Mac goes to sleep at night. Obviously, Finder isn't available via ssh, so I want to create an...

Word 2008 macro to SVN ADD current document

I want to invoke "svn add" on the current Word 2008 document. I've got a shell script that'll svn commit it later. I don't want that shell script to indiscriminately svn add files so I'd like to be able to do it from a button in Word 2008 tied a macro or appleScript. ...

Mounting a folder as a device in Finder using Cocoa

Is there a way to mount a folder on the hard disk as a device in Finder. The intend here is to provide the user with an easy way to get to a folder that my application uses to store data. I don't want my user to go searching for data in Application Data. I would rather allow them to make this data available as a mounted volume or device ...

Suggestions other than an AppleScript OSAX to create a resource bound file

I need a create a specific type of file in OS X. It needs resources in a specific way. Currently, the only way I can find to do this is in AppleScript with an OSAX. This is slow, about 1 second round trip to run, since the OSAX must open, load, do it's job, and quit. I have explored doing it in C, but that would be a last resort, as ...

Automator action to create Keynote presentation from text file

Newbie here. Thanks for looking. I need to import a text file (consisting of subtitles) into a Keynote presentation. I need to turn each subtitle into a single slide, interspersed with blank (black) slides. I'd like to create an Automator action in order to do this. I think the way to do this is to filter paragraphs ending in two line ...

AppleScript: adding mounted folder to Finder Sidebar?

I have a simple Apple Script that mounts a folder: mount volume smb://machineip/folder This runs on start up since Mac OS X 10.5.5 doesn't have the concept of mapped drives like Windows. The script doesn't go as far as I'd like though. I get the machine IP added to Finder Sidebar and when I click it, all of the shared folders for th...

How to open an email message using applescript?

Hi Everyone, I am writing a small applescript which retrieves all "unread" messages in the viewer and loops them. I have two goals to complete: I need to get the subject of each message and perform a regular expression to see if it's suitable for step 2 (ex: get emails with subject {.*}) I need to open each message on a separate wind...

How to programmatically rename movie and TV show files in an iTunes library, for XBMC compatibility?

I have a collection of movies and TV shows in iTunes, and I'd like to rename them to an XBMC compatible naming convention without breaking the links in iTunes. All the necessary metadata (season number, show name, episode number, etc) seems to be in an XML file that iTunes manages, and the episode name is the current file name. So progr...

iTunes COM/AppleScript - podcast RSS

I need to get a list of the RSS subscriptions from iTunes. I'm using the COM interface that Apple provides for controlling iTunes, and have tried this both on Windows and Mac. e.g. tell application "iTunes" repeat with a_track in tracks of playlist "Podcasts" get artist of a_track get album of a_track get name of a_...

Accessing cell properties in iWork Numbers

I'm trying a access the complete reference for a cell in Applescript. So far I've managed to get the cell reference and the table reference using a script like: tell application "Numbers" tell document 1 repeat with i from 1 to count of sheets tell sheet i repeat with j from 1 to count of tables tell table j try set currentCell to the f...

Quit All Applications using Applescript?

How would I quit all running user applications using Applescript? ...

Find Mac OSX version installed using AppleScript

Hi How can I find which version of OSX is installed on my Mac by using AppleScript? I want to install an app programatically and run different pkg files based on the version. Thanks ...

AppleScript to launch a pkg file from another package

Hi I want to run a pkg file added as a component in my package based on certain conditions. How can I run the pkg file from AppleScript? Thanks? Edit: I am now able to run the pkg file using open pkgFile.pkg I want to embed this AppleScript as part of a package along with some other packages as the components of this pakage. Where do ...

Translating Python Regexp to Shell

Hello, friends I'm writing an Applescript playlist generator. Part of the process is to read the iTunes Library XML file to get a list of all of the genres in a user's library. This is the python implementation, which works as I'd like: #!/usr/bin/env python # script to get all of the genres from itunes import re,sys,sets ## ...

Creating a new table in iWork numbers on a specific sheet using applescript

I am having trouble creating a new table on a specific sheet using Applescript unless the sheet I want insert the new table in is either new or current selected. The general form of the code I am using is: tell application "Numbers" tell document 1 tell sheet "This is the sheet I want to use" make new table with proper...

How can I AppleScript Terminal.app to copy the current text on the screen?

I see in the AppleScript dictionary that the current screen's worth of text and the history buffer are available as properties. How would I AppleScript that to copy the contents of the currently selected Terminal.app tab to the paste buffer? Could I do it on the command line? What about the whole history log? ...

Applescript Question - Adding Tracks to Playlists

Seriously, I'm embarrassed to even be asking this. I've got an Applescript that is supposed to build a playlist of a bunch of whole albums. Everything works fine, except for actually adding the tracks to the playlist. Here's the relevant code: repeat with theAlbum in randAlbums set these_tracks to (tracks of library playlist 1 wh...

How to detect which Space the user is on in Mac OS X Leopard?

Mac OS X Leopard has a virtual desktop implementation called Spaces. I want to programatically detect which space the user is currently on. Cocoa is preferable but AppleScript is acceptable if there's no other way. I've seen a couple of AppleScript implementations, but the techniques they used seemed a bit too hacky to use in producti...

Applescript, multiple monitors and maximum window sizes

I'm looking into windows management on OS X (trying to achieve something like WinSplit Revolution), and I need to use applescript to pull out the maximum size of a window on a given monitor. Currently I've found: tell application "Safari" set screen_width to (do JavaScript "screen.availWidth" in document 1) set screen_height to ...