Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Fake to automate some web tasks.

I have a CSV file on disk that contains rows of data which I'd like to use to fill out forms in my Fake Workflow.

How can I iterate thru the rows in the CSV file and access the values found in each column in my Fake Workflow?

share|improve this question
up vote 5 down vote accepted

The best approach is to use the Repeat With Action with the lines in file option selected. This allows you to read the CVS file on disk and iterate thru the rows as Fake Variables. You can then access these Fake Variables in other Actions which can fill out the web form (or whatever you need).

enter image description here

As seen in the screenshot above, I'm using a Do JavaScript action to initially fetch the current line Variable and then split it into an array of comma separated values.

var line = fake.get('line');

Then I use Fake's JavaScript API to set individual variables for each column:

var row = line.split(',');
fake.set('first', row[0]);
fake.set('last', row[1]);

Then use other Fake Actions to work with the data you've fetched. In this case, I'll fill out a simple web form using the Set Value of HTML Element Action. In this Action's text fields you can access Fake Variables with this special syntax:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.