How I can write simple text (e.g. "Hello world") to file? I must use JavaScript and code must work on Mac OS.
Asked
Active
Viewed 2,095 times
-4
-
Using what JavaScript environment? Node.js? Something else? – Quentin Jun 22 '12 at 08:44
-
Why is this tagged "java"? There is no sign of anything related to that language in the question. – Quentin Jun 22 '12 at 08:45
-
Why is this tagged "ios" and "macbook"? Are you dealing with iOS or OS X? There are significant differences between them. – Quentin Jun 22 '12 at 08:45
-
I have only one *.js file. I use UIAutomation for write my test scripts. And I don't know how I can write to file. I novice in this. – Pavel Ilyinsky Jun 22 '12 at 08:55
-
Sorry for adding unnecessary tags – Pavel Ilyinsky Jun 22 '12 at 08:56
1 Answers
1
Security limitations don't allow javascript to access the local file system through the browser.
But you can use the Node.js interpreter to run javascript "server side".
If this is the case, your code should look something like this.
-
Mac OS X Version 10.6.8. The problem: MacOS has a software-as-UIAutomation so he takes .app and .js. When just runs only it start the emulator and runs the script ... So for example use the script I take the data and I want to write to a file. Seems simple ... but I do not know how. – Pavel Ilyinsky Jun 22 '12 at 12:04