Kiran Koundinya
Kiran Koundinya

Reputation: 181

iPhone Automation - How to import "a.js" in "b.js"?

I am automating an iPhone application in Macintosh using "Intruments" tool.

and the Scripting language incorporated is "JavaScript".

I want to use the function written in "a.js" in "b.js" also. Can anyone tell me a way to achieve this.

Note : the iPhone application is not web based application and hence the following code snippets results in Parse errors

Thanks Kiran

Upvotes: 1

Views: 551

Answers (2)

Kiran Koundinya
Kiran Koundinya

Reputation: 181

#import "a.js"

The above statement will import a.js file in whatever the file you typed in and the code in that file can be re-used.

Upvotes: 1

Akshay
Akshay

Reputation: 2983

When you add the JavaScript file, Xcode detects that the file is a source code file, assumes you want to compile it and automatically adds it to the Compile Sources build phase.

To stop Xcode trying to compile it and make it copy the file instead, expand your target in the Groups and Files list, remove the JavaScript file from the Compile Sources build phase and add it to the Copy Bundle Resources build phase.

EDIT :

Maybe these links will help you -

1)Introduction to Dashcode User Guide 2)Dashcode Tips And Tricks

Good Luck

Upvotes: 0

Related Questions