applescript

Creating Help Files - Applescript Studio

I would like to know how to generate help files for an applescript studio application I am currently creating. I have tried many different options of creating help, and googled it for quite some time and cannot find an answer. When I click on the menu item "Application Help" in my application it opens Help Viewer with an empty window w...

How do I deal with typing nested message calls in ObjC source from only the keyboard?

I think over the last year and a half, while experimenting with Cocoa and Cocoa Touch development, I've been struggling with getting Xcode to support a kind of key macro to handle this specific coding scenario... I frequently find myself not knowing ahead of time how many message dispatches to chain together while typing a new line of c...

How do I get the file path of an iTunes Selection

I'm trying to determine the path of track selected in iTunes using applescript. It doesn't seem to be a property of the track. Can anyone tell me how I can get the file path. Thanks Kartik ...

AppleScript how to get current display resolution?

Hi, I'm trying to get the current display resolution of both of my displays depending on where the mouse cursor is. i.e. when the mouse cursor is on the first display I want to get the resolution of this display. With a shell script I can get both resolutions: set screenWidth to (do shell script "system_profiler SPDisplaysDataType | ...

Sending commands and strings to Terminal.app with Applescript

Hi, I want to do something like this: tell application "Terminal" activate do script "ssh [email protected]" -- // write user's password -- // write some linux commands to remote server end tell For example to log in to the server, enter the password, and then login to mysql and select a DB. I type that every day and it would be...

Retrieving a track with particular path from iTunes' Music library

I need to get a reference to track object from music library by using track's path. I know the path in advance and I'd like to be able to get the track without iterating through the entire library. I'm trying the following code and getting "Descriptor type mismatch" error. tell application "iTunes" set musicLib to (get some playlist...

How does one feed a list of files into an app with appscript and Python?

Get your newb-shields up, I'm about to sprinkle you with some. I'm trying to get Photoshop CS4 to open a folderful of JPEG images with AppScript+Python, which could be described like so in BASH: #!/bin/bash for F in `ls ~/Desktop/test`; do open -a "Adobe Photoshop CS4" $F # proceed to mutilate the image appearance done I'm f...

Getting folder actions to run a shell script

I'm trying to to write an applescript that will run any shell script that is dropped on a particular folder on my network. I've been trying with: on adding folder items to target_folder after receiving this_script tell application "Terminal" to open this_script end adding folder items to Any ideas? ...

Tools to create the file necessary to integrate an application with AppleScript

Are there any tools that allow to create the necessary files required to add the support for AppleScript in an application? I am looking for a tool that simplifies the task, possibility one that requires me to just give a description of the involved classes. ...

Search Mailbox of Mail.app with Applescript

I want to be able to search a mailbox in apple's mail.app for a phase or word, then somehow return or copy all of the email addresses from which the emails which have successfully returned from the result of the search have been sent from.. if you get what i mean I thought that the only way to do this is probably applescript but if anyo...

How do you get the playtime of an iTunes track with applescript?

I'm just starting to play around with Geektool and applescripting to make my mac desktop fun and I've run into a question I can't seem to find an answer to. How do you get the current song playtime from an osascript command? I've found great resources on how to do just about anything else with iTunes and osascript on the command line b...

Remove address fields from Mac address book using Applescript

Hello, A Facebook Sync app filled the address fields of my Mac Address Book contacts with their cities. Having tons of people who have useless addresses makes it difficult to search by people on Google Maps app (ending up scrolling through many many people- I only want to see those who have proper addresses entered). I want to clear al...

How do I search iTunes using Applescript?

How do I search for every song match certain criteria? E.g., something like: tell application "iTunes" set tracks to (every file track of playlist "Library" whose name contains "Green") repeat with t in tracks display dialog (t as string) end repeat end tell ...

Accessing a Track Name in iTunes via iTunes' plist (XML) File

I've learned that iTunes XML file is actually a plist, and instead of trying to parse the raw XML, I could use property lists. I'm able to access the "Tracks" section, but I'm able to unable to do anything simple like extracting a track name. Admittedly, I'm stumbling around a bit, but this is the code I've gotten to so far: tell app...

Error On Say Function

I'm using the Apple Script Editor that came with Mac System 7.5.5 and trying to run a simple program: say "Starting to empty the trash." tell application "Finder" empty trash end tell say "Finished emptying the trash." But when I click in the run button, I got this: I got this code from the book AppleScript Language Guide from Ap...

How do I check if a key in a record exists?

I discovered that if I try to access a field in a record, e.g.: set track_album to (|Album| of t) And that field does not exist, AppleScript throws an error. How can I check if that field exists first? Or how to let it fail silently? (Whichever is the best practice.) ...

How to resolve "internal table overflow" in Applescript

When attempting to load the iTunes XML/plist file, I get "internal table overflow." After Googling, it looks like Applescript has run out of memory. The file is 18 meg on disk, so while on the larger side of things, it should still work on a Mac with 2 gigs. How can I resolve this? Obviously, since it's created by iTunes, I can't c...

screen selection for recording

Hi i am building an application using AppleScript for screen and audio recording. For screen recording i want user to select the screen as we select for screen shots. Can any body help me? ...

How do I diagnose a compiled Applescript that just quits at startup?

I wrote two applescripts so that my wife could launch mt-daapd and shut it down easily. They work fine in the Script Editor app but when I compile them into stand-alone apps, the apps work the first time I test them. Then they embarrass me as I proudly show them off to my wife. I see the "open" animation and then they just sit there. I'v...

How to get variable value of applescript in cocoa ?

NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init] ; NSAppleEventDescriptor *eventDescriptor; NSAppleScript *script ; NSString* source ; NSDictionary* errorDic ; source=@"tell application \"iTunes\" \n" @"set tname to name of track 1 of playlist 1 \n" @"set tartist to artist of track 1 of playlist 1 \n" @"set talbum...