Dragging folder to a field under linux adds "file://" before the folder
Matthias Rebbe
matthias_livecode_150811 at m-r-d.de
Sun Sep 25 05:46:19 EDT 2011
Richmond,
thanks for your answer. So i do not have to worry about that my script might be causing this.
Regards,
Matthias
Am 25.09.2011 um 09:45 schrieb Richmond Mathewson:
> On 09/25/2011 03:34 AM, Matthias Rebbe wrote:
>> Hi,
>>
>> i want to drag a folder into a field to get the path displayed. I am using the following code in the field script:
>>
>> ON dragEnter
>> IF there is a folder the dragdata["files"]
>> THEN
>> set the dragaction to copy
>> END IF
>> END dragEnter
>>
>> ON dragDrop
>> set the text of me to the dragdata["files"]
>> END dragDrop
>>
>>
>> This works fine under Win and Mac OS x. The path is displayed correctly. Under Linux there is "file://" added before the path.
>>
>> For example the path /home/matthias/desktop becomes file:///home/matthias/desktop
>>
>> If i do not use any script in the field, the path is displayed correctly without the leading "file://".
>> But I need to use a field script, because my original script is doing some adjustments to the path (replace backslash with slash under windows). Is this Linux specific? Or am i doing something wrong? I know i can solve this with
>> "replace "file://" with "" in field ...." , but i would like to know and understand why "file://" is added to the path.
>
> At the risk of sounding moronic; because the object you are dropping, results in a file path, and, on Linux all files paths are prefixed with "file://". Your file path IS displayed correctly on
> Linux, in a Linux fashion.
>
> Anyway, all you need is a wee script to strip out the "file://",.
>>
>> Regards,
>>
>> Matthias
>>
>>
>>
>>
>> _______________________________________________
>> 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