applescript

How to pass an arbitrary AppleScript Record to Cocoa in a scriptable app?

I have a Cocoa application with an AppleScript dictionary described in a .sdef XML file. All of the AppleScript classes, commands, etc. defined in the sdef are working property. Except for my "submit form" command. The "submit form" command is my only command attempting to pass a parameter that is an arbitrary hashtable of information f...

Bash output as Applescript list problems.

This is just driving me nuts. I am trying to read a file in bash, remove duplicates, sort, and then display a "list choice" window via applescript. My $DATALOG file is formatted like this: field1 field2 field1 field3 field1 field4 etc... Applescript=awk '{print $2}' $DATALOG | awk ' !x[$0]++' | sort -u | tr "_" " "| sed 's/^/\"/'...

Receive Adium messages in Applescript

I'm trying to write a simple chat bot for Adium, that will post "lol" and "haha" and answer basic questions in annoying group chats that some people keep adding me to. I've covered the "lol" part with a few simple send and delay commands in a repeat, but I need to do some interaction as well. Answer "yes" to anything with a question mar...

Creating a new document via AppleScript results in a document with no title

I am making a Cocoa NSDocument-based app scriptable. If I try to create a new document with the following AppleScript: tell application "MyApp" to make new document a new document is created, but its title is nil. Any ideas on why this would happen and how to fix it? ...

Using Applescript to create a Smart Mailbox?

I am trying to automate the creation of a smart mailbox in Apple Mail using criteria based on the currently selected message (e.g. create a folder to display all messages from the person who sent the current message). Clearly, I can go in and create a smart mailbox by hand, but because I do this regularly I am hoping to automate it. I ...

How do I make a voting poll in AppleScript?

I would like to make a voting poll in AppleScript, I would like to customize the values and I would like the system to tally the results and email the final result to me at: [email protected]. Please reply ASAP! Thanks! ...

Save and open later space configuration in Mac OS X

Hi, let's say that I am working using several spaces. In one of them I ahve 20 applications opened with its respective files. Computer crashes and I have to open everything again, or just, I want to save this configuration, so later, I open this config, and inmediately, all these 20 apps open with those files, and even better, in the sa...

Alternatives to Applescript?

When it comes to scripting the Mac, are there alternatives to Applescript? It's API seems awesome, but the language it self, from what I've read so far, seems aimed more at non-programmers. Insights into this would be great helpful. (At the moment, I'm thinking of writing a tiling window manager for the Mac). Yes, I know some exist, bu...

open an application with appelscript in an exact space

Hi, ist it possible to open an application with appelscript in an exact space? Thanks ...

How to remove the screensaver password on OS X with apple script or shell?

I want to write a little apple script that disables my screensaver password whenever my phone is in range with Bluetooth. I have spent quite a bit of time search and I have not been able to actually find anything that works. I have tried things like: defaults -currentHost write com.apple.screensaver askForPassword -int 1 But, this do...

make AppleScript program that listens systemwide for shortcuts

I'd like to create some kind of background process that listens to all keystrokes event and acts consequently (for example does some action if CMD-A is pressed while in Finder.app, or more complex things, like sequences to create shortcuts like in emacs..) But how can I listen to keypresses systemwide on SnowLeopard? I thought of Apples...

On MAC O.S., how to get the name of files that has been dropped onto apple script to boot JAR with the name of file as a argument to JAR

In Script editor i have written a command to boot the JAR. do shell script "cd /Desktop/RunJar/; java -jar RunMyJar.jar" and Saved as script file as a Application. When i click on script file jar get run. My requirement I would like get the name of file that has been dropped onto the script file and would like to pass the name...

Open a file directly to emacs (by double-clicking)

How would I go about setting all .rb files or all .py files to open in emacs if I double-click them; say, from the desktop? I'm on OS X 10.6.2. I have the script: on open of finderObjects repeat with currFile in finderObjects set unixPath to POSIX path of currFile set base to do shell script "dirname " & unixPath...

Why can't I retrieve "contents" of a note item in Yojimbo, but I can retrieve the "content"?

A note item in Yojimbo's Applescript dictionary is defined as: note item n [inh. database item] : A note item. elements contained by application. properties encrypted (boolean, r/o) : Is the note is encrypted? contents (text) : The contents of the note. syn content If this note is encrypted, the contents property is only rea...

How to make the apple script file configurable ? can apple scipt file, shipped from window ?

In Script editor i have written a command to boot the JAR. do shell script "cd /Desktop/RunJar/; java -jar RunMyJar.jar" and Saved as script file as a Application. When i click on script file jar get run. As the apple script file has been saved as application we can not open the file on WINDOWS O.S.. so we are looking to configure t...

Applescript Help : Copy file to a new Pluged USB Device.

Hi there I wanna do an Artist Instalation, that invites ppl to plug in theyr USB drive into my Piece of Art, when they do that I copy to theyr USB some of my artowrk. I wanna do this usign apple script but im not a programer, digging arroudn found this code that copy files to a directory, what I wanna change now is that directory, I nee...

Prevent Email From Being Sent via Applescript

I've got the following AppleScript (below). I'm attempting to confirm the sending of an email. This AppleScript is already successfully hooked up to an "outbox rule" (using Mail Act-On) in Mail.app, and I've verified that it runs when it is supposed to (at the time of sending). The ultimate goal is to pop a dialog to the user, asking if...

How to Duplicate an AppleScript function in Objective-C?

This AppleScript code gives the name of files that have been dropped onto the script. How do I do the same in an Objective-C app? Would an application written in Objective-C be able to boot the JAR file using the file name as an argument to JAR? on open of theFiles -- Executed when files are dropped on the script set fileCount to (...

How do I access hidden files in Finder with Applescript?

defaults write com.apple.finder AppleShowAllFiles ON Now it works tell application "Finder" to get folder ".spring" of home #folder ".spring" of folder "username" of folder "Users" of startup disk of application "Finder" ... defaults write com.apple.finder AppleShowAllFiles OFF Now it doesn't tell application "Finder" to get fol...

AppleScript -- How to change the default Printer based on network

Hello, I would like to make an application that will run on my computer that will change the "Default Printer" in the "Printers & Fax" Preference Pane of "System Preferences" through AppleScript? I want it to change the printer based on my wireless network that I am on. I will quit and start with every network change if I have to, b...