views:

803

answers:

2

I have a C# web application that needs to deploy a file to the client computer's hard drive. (A javascript file for Adobe Acrobat)

If the client is using a mac, I have an applescript that will search their applications directory for acrobat and then deploy the JS file in the correct location.

The problem is that I am currently creating the applescript on a mac, and then moving it to the server. The applescript has at least one message (to say it has finished successfully), and this message needs to be displayed in the user's language of choice (specified in the web app)

So, is there some way to create the applescript on my windows C# server (with the embedded language string) and then send it to the client?

+4  A: 

I can't think of a good way to dynamically generate an AppleScript (especially on a non-Mac OS platform), but couldn't you have the C# (ASP.NET?) server write to a file, and have the AppleScript read the message from that?

Sören Kuklau
+3  A: 

I ended up taking Soren's advice. I compiled the applescript on a mac, zipped it, and moved it to my windows server. Then I can use a zip library dynamically to add a txt file to the archive.

The applescript has code in it to read the contents of the text file: http://stackoverflow.com/questions/281108/applescript-application-read-from-file

Mike Blandford