Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

gmayassi

macrumors newbie
Original poster
Hi Guru's
How to pass parameters from external applications e.g. Filemaker to an applescript?

Sample Script:
=====
tell application "iCal"
tell calendar "Work"
make new todo at end with properties {description:TDDesc, summary:TDName, due date: DDate}
end tell
end tell
=====

Where TDDesc, TDName and DDate are global parameters that are defined in the external application.

Thanks & regards

Gus
 
from "man osascript":
SYNOPSIS
osascript [-l language] [-s flags] [-e statement | programfile]
[argument ...]
...
Any arguments following the script will be passed as a list of strings to
the direct parameter of the ``run'' handler. For example:

a.scpt:
on run argv
return "hello, " & item 1 of argv & "."
end run

% osascript a.scpt world
hello, world.

So it looks like if you invoke your script via osascript this is possible. You won't have direct access to variables in your external program, but if your external program can run commands (via C's system or something similar) you should be able to compose your command and add these variables as arguments.

-Lee
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.