getting File Name
JB
sundown at pacifier.com
Mon Aug 11 02:54:28 EDT 2014
Hi Scott,
I am using a Mac and it allows a / in the
name. If a / is in the name I think that if
you simply get the last item it would not
give you the full name.
John Balgenorth
On Aug 10, 2014, at 11:15 PM, Scott Rossi <scott at tactilemedia.com> wrote:
> Hi John:
>
> Does the following also do what you want?
>
>
> answer file "Select a file:"
> set itemDel to "/"
> ask "File Name" with last item of it
>
>
>
> Regards,
>
> Scott Rossi
> Creative Director
> Tactile Media, UX/UI Design
>
>
>
>
> On 8/10/14 10:00 PM, "JB" <sundown at pacifier.com> wrote:
>
>> Here is a handler I wrote that will return the file name.
>>
>> on mouseUp
>> answer files "Select the file you want the Name of:"
>> put the longFilePath of line 1 of it into filePath
>> set the itemDelimiter to tab
>> put number of chars in filePath into n
>> repeat for n times
>> if char n of filePath = ":" then put "/" before fileName
>> else put char n of filePath before fileName
>> if char n - 1 of filePath = "/" then exit repeat
>> put n - 1 into n
>> end repeat
>> ask "File Name" with fileName
>> end mouseUp
>>
>> John Balgenorth
>>
>> _______________________________________________
>> 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