Replicate, Change and Save As

Joined
Sep 22, 2011
Messages
1
Reaction score
0
Hi all,
I'm kind of new to Automator and I think I've got a bit of a mountain to climb here. I seriously need help! Not even sure if Automator can do this or if it'll be AppleScript but here goes...
I have a website. This website needs to have different pages for every town in the UK. I have a template php page for this and inside this template page is a line of code ending with a bracketed number, like [0]. This bracketed number corresponds with a town name on a spreadsheet I have. The spreadsheet is simple. Column A has the town names. Column B has numbers, simply 1, 2, 3, etc. So, for example, Aberdeen = 1, Abergele = 2, and so on.
What I need to do is create a workflow which opens the template php page, finds the bracketed number, changes the number up one, then looks at the spreadsheet, finds the corresponding town name to that number and then saves the template with that town name as the filename and with a php extension.
So I will end up with a folder populated with a couple of thousand files, each with a unique filename of a town name and each with it's own unique bracketed number.
I need the option to browse to all variables (template file, spreadsheet, containing folder and destination folder) but only in the first instance. Not for every 'save as' action.
I'm not really sure of the best way forward. Would repeatedly using the template file for every 'save as' cause problems for replacing the number as there would be no trail of numbers to check against? Or would it be better to open the template to start and then use some kind of count function, building up each time from the last?
I'm pretty stumped!
 
Joined
Nov 26, 2010
Messages
3,558
Reaction score
52
Don't know much about php.
But this isn't a job for Automator.

I would start by exporting the spreadsheet into a CSV.
Then maybe AppleScript with TextEdit?

Wouldn't it be easier to mod the php to read the CSV???

this sounds trivial but it's not.

How often does this need doing?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top