How to manage file name containing a date with /
André Bisseret
andre.bisseret at wanadoo.fr
Tue Jul 23 14:26:43 EDT 2013
Thanks a lot Thomas for your precise questions; that help me a lot to better explain my problem.
That's what I am trying below.
Le 22 juil. 2013 à 23:03, Thomas McGrath III a écrit :
> Andre,
>
> You are not answering the proper questions to come up with a solution for this.
Well ,I was trying to be as simple as possible (but I understand that was not efficient!)
------
Since 2006 the doctor is using an app I developed according to his needs.
In this app. he creates one stack (medical record) for each patient with all the necessary informations about the patient.
At each consultation he created a new card in the stack of the patient.
- In a field he writes his prescriptions that can be printed.
- In another field he writes his observations, and any information he thinks useful to the follow-up of the patient.
This is in the form of short rather laconic sentences. They may be completed by a document (a PDF file which can be open from there:
at the end of some such sentences he can create an" icon": in fact, a char "#" with a little image-source (DOC).
such as when it is selected (double-click) the corresponding file is launched.
A bit difficult to explain shortly how this is done:
On his disk, In the folder where all the material of the app. is located he has a folder, say "DOCS BASE" where he put all
the documents (mainly PDF files) concerning all his patients.
When he opens the stack of a patient, the list of the documents concerning this patient is built (from the DOCS BASE) and put in a custom property of the stack of the patient.
When on a card of consultation in the stack of a patient, thanks to a button he cans show a field (normally hidden) where the list of documents concerning the patient is put in this field (using the custom property)
Doing shift key + click on the name of a document in this list creates a little image (DOC) whose a custom property is the name of the document.
selecting the char # then clicking on the image, set the image source of the char # to the new image which is then hidden. (these images have as names doc 1, doc 2 etc).
And then, each time he double-clicks on such an "icon" the corresponding file (custom property of the image source) is launched.
Hoping it is not too obscure!
Now, this doctor is going into retirement at the end of this year.
He would like to give to each of his patient, on a USB key, a synthesis of their medical record so that they can give it to the new doctor they will choose.
That is the new app. I am about to complete.
One click on a specific button "create transfert folder" create the folder that will be dragged on the USB key of the patient
This folder will contains
- a standalone for mac
- a standalone for Windows.
- a sub-folder containing all the document files concerning this patient (they have been copied from the folder "DOCS BASE")
on Mac the names of these files in this folder keep the slash as separator of the date
not on Windows : there is the bizarre dot in place of the slash.
- other files : in particular a stack which is a copy of the last consultation (last card) of the stack of the patient (his medical record)
So on this stack there can be double-clickable "icon" which should open the right document.
in the script of this stack :
=========
local tCharNum,tFieldNum,tDocName,tPath,
-------
on selectionChanged
if word 1 of the selectedText is "#" then
select word 1 of the selectedChunk
put word 2 of the selectedChunk into tCharNum
put last word of the selectedChunk into tFieldNum
--- TitreDuDoc is the custom property of the image whose the value is the name of the file
put the TitreDuDoc of img (the imageSource of char tCharNum of fld tFieldNum) into tDocName
-------- adapting the accented characters to Windows
if the the platform is "win32" then put macToISO(tDocName) into tDocName
--------
set the itemDel to slash
put the filename of this stack into tPath
put tDocName into last item of tPath
launch document tPath
end if
end selectionChanged
============
> Questions:
> 1. Where are the files located when using the Mac version of your app? (same computer? different computer?)
same computer (the computer of the reader
> 2. Where are the filed located when using the Windows version of your app? (same computer? different computer?)
idem
> 3. Are they on a server?
no
> 4. Are they included with the app when passed on to a Windows machine?
they are in a folder which is at the same level as the app
> 5. What happens when you -- answer file "Choose a file:" -- do they show up?
on Mac, yes; on Windows, no
> 6. If so what happens when you -- put url ("file:" & it) into tFile -- does tFile hold the correct full path or does it just say "2013.pdf" ?
For it and for tFile as well I get a very long text with cabalistic characters!
But I am not at all familiar with the use of url so possibly I am not scripting correctly
-------
put the filename of this stack into tPath
set the itemDel to slash
delete last item of tPath -- the stack and the file are in the same folder
answer file "Choose a file:"
if it = "" then exit to top
put URL ("file:" & it) into tFile
---------
> 7. Please post the code that you are trying to use so that we can see it and help you.
>
see on selectionChanged above
> Suggestions:
> 1. Stop the process of naming files with a "/" -- instruct the client how to change this in the scanner software.
OK, no problem
> 2. If the files exist on the Mac then why not run a batch on them and rename them all with a correctly formatted name -- then ship those to the Windows users. Do this with LC.
I think that might be the best thing I could do eventually!!
> 3. If there are many files 'and' many Mac and Windows users are to access them then suggest a server -- that way all of the clients can use the same code to access them.
> 4. If the answer file shows them then use 'it' to choose them.
The readers can't choose the right file; we have to open it for them when they double-click on an "icon" (DOC)
> 5. If put URL ("file:" & it") shows the correct file path then use 'it' to choose them.
> 6. If not THEN you need to deal with the file name issue as suggested previously.
>
> I know we can solve this one if we know enough about the workflow.
Thanks you again for your attention
Best regards
André
>
> Yours
>
> Tom
>
> -- Tom McGrath III
> http://lazyriver.on-rev.com
> mcgrath3 at mac.com
>
More information about the use-livecode
mailing list