Simple Client Record Manager

I want to create a macro with a Prompt with list action that allows me to add a new record for a new client to a tab-delimited file Clients.txt, edit an existing record or simply retrieve a record via the system clipboard.

I'm having problems with getting the If-Then logic correct.

If I select -Add a new client in the Prompt with list, a Prompt for user input is displayed and the new client's data are written to the file Clients.txt. So far so good.

But now ...

  1. How and where do I place the second condition, check for user input of -Edit an existing client?
  2. How can I overwrite the record for an existing client in Clients.txt with the edited data?

Add, edit or get a client's record.kmmacros (11.9 KB)
Clients.txt.zip (703 Bytes)

Seems like you were close. I think your if/tnen statement is still in a good place.

But I would do this for the overwrite - Modifying your prompt:

Unless I'm misunderstanding what you are trying to do.

KC

1 Like

I wonder if your IF statement should be a SWITCH statement?

1 Like

I think that’s what I need. Will try tomorrow. Thanks.

I was indeed missing this Case action (because of the name 'Switch', which I didn't recognise). Thank you for pointing me to it. Will try to finish the macro tomorrow.

Here is the enhanced version, allowing adding, editing and pasting a record. I'll use it for a client 'base', but I think that the techniques are so generic that other KM users can adapt it for their own purposes?

1


Add, edit or get a client's record.kmmacros (17.1 KB)
Clients.txt.zip (701 Bytes)