applescript

How to run apple script after completion of previous one

Hi. I am to running some terminal commands using apple script. The problem i am facing is that i want to run 2nd command only after the 1st one finishes. I can not add delay statement bcoz the finishing time of command 1 is not fix, it changes as per the size of file for which i am running that command. How to do that? Can any body h...

Creating an AppleScript to do a find in a replace in a given document

I'm looking to create aAppleScript that when run will: Search the document for a given string Replace that string with another given string The strings will always be the same Search for This will be used in textmate - I was trying to do this in textmate I know I can use textmate's find and replace functionality - I'm just trying...

Access Text Boxes (in a Keynote slide) in AppleScript

Need some help to figure out how to access Text Boxes inside a slide in Keynote with Applescript. I tried to use ASDictionary but I couldn't find anything that would resemble a text box object. I fear that they are not scriptable in Keynote, but perhaps I can access them through Applescript Cocoa bridge? Any thoughts? Thanks! ...

is there a way to eject all external hard drives from the command line? (OS X)

Is there a way to eject all the mounted hard drive volumes on an OS X computer from the command line? Applescript is OK if I can wrap that in a shell script. ...

Mac Office 2008 Development- AppleScript vs. VBA

I'm looking for some advice from anyone who has experience writing addons for PowerPoint on both Windows and Mac machines. We have a Windows Office 2007 addon (.NET) that we'd like to port to the Mac. Thus, in PowerPoint 2008 for the Mac, we require the following functionality: Ribbon/Fluent extensibility Custom Task Panes Re...

False Applescript result in Cocoa

Hi, I have 3 tracks in iTunes and run this procedure: -(IBAction)reloadButtonClick:(id)sender; { NSAppleScript *script ; NSString *source ; NSString *result; NSDictionary *errorDic ; NSAppleEventDescriptor *ed; int total; source= @"tell application \"iTunes\" to get cou...

Contextual Menu Item development for OSX (Leopard and Snow Leopard)

i was wondering what the best practice is for creating a contextual menu item that would work in both leopard and snow leopard and works with a selection of files and/or folders, sending them to a shellscript. i know that the contextual menu items have been deprecated in SL - but does that mean there is no way to create a solution that...

Get file name using drag-and-drop

Hi I have written applescript to get file name. on open of thisPDF set fName to thisPDF as string (* - - my code comes here. - - *) end open When i drop any file on my application's icon. This code help me to get the file name in fName variable but this gives me the path of that file like "MacHD:Users:my Name:Desktop:file Name" ...

Mac: reloading document in Chrome or Firefox?

How can I tell Chrome or Firefox to reload the document in the top window? Here's what I'm using for Safari: osascript -e ' tell application "Safari" activate do JavaScript "history.go(0)" in document 1 end tell ' ...

What applescript will a particular application accept?

I see a lot of applications that can respond to applescript messages such as this one. tell application "Safari" return URL of front document as string end tell How can I query an application to find out what commands it will accept? Is there a tool for doing so? ...

Get full directory contents with AppleScript

I need to get the entire (visible) contents of a folder and its subfolders as a list. Is this possible? ...

Communication between applescript and FileMaker

I'm currently writing an applescript to be run within FileMaker. I need to tell filemaker what the name of its application is (FileMaker Pro or FileMaker Pro Advanced or whatever) so that I can within ANOTHER applescript within filemaker I can say "tell application filemaker" I currently have a script that figures out the name of the ap...

Automate Post Of Login Details User & Password Into Safari For Scraping

Hi To All, I am wanting to automate the input of post variables on a login page for the purpose of webscraping. It would improve the process no end if I can get past the login page. Then I can schedule some functions to run on cycle automatically. (Had a go with some CURL commands but could not get the result) Thanks for any help,...

How can I do something later, but get the applescript to return now?

I have an applescript that does something similar to: using terms from application "iChat" on logout finished delay 30 … do some stuff end logout finished end using terms from The problem with this script, is that it also blocks the application calling it for the 30 seconds. What I would like to do then is say something li...

Adding validation to Action Installer

Hi. I have downloaded a automator action installer package and made some changes in it as per my requirements using AppleScript. But I am not able to provide the license validation to that action installer pack. Can any body help me on this. ...

Applescript to run at shut down

Hi all, I am trying to make an application using AppleScript which can remind to check my mails, if I forget to check, at shutdown. I took help from this link: http://discussions.apple.com/thread.jspa?threadID=1375949&tstart=0&messageID=7088687#7088687 In this link they have suggested that I can run a quite application which c...

AppleScript or Automator to click on menus in an application?

Hi, I'm not sure if this is do-able via AppleScript and/or Automator…but I'd like to be able to: a) launch an application (I know this can be done pretty easily by AppleScript or Automator) b) once the application is launched, use AppleScript or Automator to select specific menu items. e.g. I'd like to launch Excel 2008 (I have the ...

AppleScript or Web Page to update Host Name?

I have never written anything in AppleScript, either by hand or with Automator, so I'm trying to decide whether my overall goal justifies the time and effort spent on making a script... Basically, I manage the LAN in my complex, and there are 20-40 residents. About half are Mac users, and I've noticted that it is fairly consistent that ...

AppleScript to refresh iTunes track at a filesystem path

I want an Applescript that refreshes a certain song in iTunes from a file. To address the file in iTunes, i have only the path to the file. I tried it on my own with "refresh" and "file track" but I'm a total newbie on AppleScript so I didn't got anything to work. ...

how to edit .globalpreferences.plist without logout and login?

I want to make a kiosk application in mac. So, I want to disable certain hotkeys which can be done by editing .globalprefernces.plist file but it is requiring a relogin to system and I want to do it without relogin. Similarly as System preferences application do but programatically without pooping the system preferneces applicaiton. Tha...