How to manage file name containing a date with /
Dar Scott
dsc at swcp.com
Mon Jul 22 11:05:15 EDT 2013
On Jul 22, 2013, at 8:36 AM, André Bisseret wrote:
> Thanks Dar for your prompt reply
>
> Le 22 juil. 2013 à 15:16, Dar Scott a écrit :
>
>> André,
>>
>> I'm not sure why this will not work to create the file name:
>>
>> get "Joe PATIENT - bio checkup - 09" & numToChar(240) & "2013.pdf"
>>
> I am doing something similar :
> put quote & numToChar(240) into tVar
put numToChar(240) into tVar
> replace ":" with tVar in tDocName
> so that I obtain the same tDocName as those you are suggesting
> then I build the filename of the document (the document is in the same folder as the stack from which I try to launch it)
> so I put the fileName of this stack into tPath
> set the itemdel to slash
> then I put tDocName into last item of tPath
> so that I get something like "C:/Users/aBisseret/…/…/Joe PATIENT - bio checkup - 09"ð2013.pdf
> but then
> launch document tPath does not work!
That is what I was suggesting, with the fix above. But, now I have less faith in that. It might be that that character is not really there but is displayed by Windows Explorer.
>> I think I might not be understanding the situation. Are these all files on a network file server or a portable storage? They look one way (with colons) on a Mac (with colons) and look another way on Windows (with the dot)?
>>
> A folder "Joe PATIENT" is on the disk of the computer. In this folder there is a sub-folder where are a stack say "Consultation Joe PATIENT" and, at the same level, the documents (files) that concerns him (a dozen or so)
> On the stack "Consultation Joe PATIENT" there are "buttons" (kind of) , one for each document the name of which being a custom property of the button.
> I am trying to launch these document in the script of these buttons.
>
> I hope I am not too obscure
I think I'm obtuse. How did files with bad file names get created to begin with?
Or do you think that there is a file "2013.pdf" in the folder named ""Joe PATIENT - bio checkup - 09"? Then maybe a slash would work. The colon is the old path segment divider for the Mac.
>
> Thanks again for your kind attention
>
> André
>
>> I also may have made an error in character encoding calculation. I'll double check that.
>
> I find the same (240)
>>
>> Dar
>>
>>
>> On Jul 22, 2013, at 6:50 AM, André Bisseret wrote:
>>
>>> Bonjour,
>>>
>>> Jacque, Dar and Peter, thank you much for your attention to my problem.
>>> Since your posts I made a number of trials during the weekend, following your suggestions but with no success.
>>>
>>> Reminder : the names of the files I am trying to launch from script have the following format :
>>> Joe PATIENT - bio checkup - 09/2013.pdf
>>>
>>> On Mac the slash is replace automatically by colon (:) (don't know why!)
>>> Anyway, all is working well
>>> I can open a file by double-clicking on it in the folder
>>> And, I can launch it by script (using its filename). No problem.
>>> -------
>>> On Windows, the : (colon) is replaced with what seems to be a character ( a kind of dot. (or small bullet point?) with a sort of white space before it and a white space after. But, these are not "space" character (one can't delete them; on can only select the all
>>> - Double-clicking on a document opens it (good)
>>>
>>> - But to launch a document from a script I need to replace : (colon) with this dot in the filename of the document.
>>> I can't!!!
>>> - When I copy this "dot" and paste it in the script editor, it is immediately replaced with "?"
>>> and replacing colon by ? does not work
>>> -----
>>> I tried pasting it in the message box: there, it is immediately replace with "ð :(quote followed by ð
>>> trying to replace colon :
>>> - I can't use "ð (I suppose it's because they are 2 characters)
>>> - trying only ð does not work
>>>
>>> - In the message box of the PC I tried to get the number of this (kind of) dot
>>> put CharToNum('') and pasting a copy of the "dot" between the 2 quotes as suggested by Jacque
>>> the dot is immediately replaced by "ð
>>> and I get the error: error: Script: missing " after literal
>>>
>>> the ASCII number of " is 34 and those of ð is 240
>>> so I tried put numToChar(34) & numToChar(240) into tVar
>>> replace ":" by tVar in tDocName > does not work
>>>
>>> I don't know what I could do next?
>>>
>>> Dar, there are several thousands files with such names ; I can't imagine the only solution be to change ( manually) all these names!
>>> I am using livecode (rev) since 2006; it is the first time I am blocked that much
>>>
>>> Any other idea?
>>>
>>> Thanks a lot in advance for any help
>>>
>>> Best regards
>>>
>>> André
>>>
>>>
>>>
>>>
>>>
>>>
>>> Le 19 juil. 2013 à 17:24, J. Landman Gay a écrit :
>>>
>>>> "André Bisseret" <andre.bisseret at wanadoo.fr> wrote:
>>>>> So I tried
>>>>> put quote & numToChar(240) into tVar
>>>>> replace ":" with tVar in tDocName > again no success
>>>>>
>>>>> When I paste the mysterious char directly in the script it is
>>>>> immediately replaced by "?"
>>>>
>>>> In the message box, do this :
>>>>
>>>> put charToNum('')
>>>>
>>>> and paste the copied character between the quotes. That gives you the actual number of the character being used. Then in your script use numToChar(<whatever>) to do the replacements.
>>>> --
>>>> Jacqueline Landman Gay | jacque at hyperactivesw.com
>>>> HyperActive Software | http://www.hyperactivesw.com
>>>
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list