Custom Desktop Folders

Ray ray at linkit.com
Fri Apr 17 07:57:06 EDT 2015


That's it!  Mike, thank you so much for your help on this.  It's been a 
tricky thing.  For the life of me I still can't figure out a few aspects 
of this, for example, why folders return to Read-only after I manually 
un-check that box in the folder's Properties window.  But the Livecode 
work and setting the icon from the Shell function is working and that's 
what I needed.  So once again, thanks!

On 4/16/2015 6:29 PM, Mike Bonner wrote:
> S attribute marks a system file.  Most likely, the A was already set.  It
> sounds like its not taking multiple attribs at once. You might try attrib
> +h +s for the ini file, and then (if 8 is the same) +r for the folder after
> all is said and done.
>
> If you can't get +s and +h to both set in one command, you could do 2 shell
> calls.  I think I read (probably in this thread) that xp requires one of
> them to be set (H or S) and everything else takes the other. But it
> shouldn't hurt to set both on all operating systems.
>
> If you set the defaultfolder to the inside of the folder you're working
> with, you can then just do: get shell("attrib +h +s desktop.ini" without
> messing with the path. Then, to set the folder to read only you can do get
> shell("attrib +r ." <-- notice the dot to designate the current folder.
>  From my tests you MUST set the folder to read only to get it to work.
>
> I have a working stack here, let me clean it up a little and I'll link to
> it.
>
> Ok, here it is.  I have an icon saved to a property, all it does is create
> the folder, pop the icon in, create the desktop.ini, and set attributes. I
> had to put a 50 millisec delay in front of the shell call to attrib to get
> it to work.  I suspect that is part of the problem you've been having
> getting them to set.  The filesystem/os stuff isn't quite done yet when you
> true.  Also, I did the setting with 1 shell call, +h +s works.  +sh is an
> invalid option, so you have to break out each one.  I think I knew that at
> one time, now I know it again!
>
> Herea a link to the file:
> https://dl.dropboxusercontent.com/u/11957935/seticon.livecode
>
> On Thu, Apr 16, 2015 at 3:50 PM, Ray <ray at linkit.com> wrote:
>
>> This is really interesting.  I'm now using the following:
>>           get shell("attrib +HSA "&desktopIniPath&"")
>>           get shell("attrib +h "&desktopIniPath&"")
>>           get shell("attrib +r "&desktopIniPath&"")
>>
>> and having some success.  When I check the Dsktop.ini file's attributes I
>> now see them set to "HA".  This is progress but I'm still missing the "S"
>> in the HSA and not seeing the icon as a result.
>>
>> Any ideas on what that S means and how to set it?  I'm using Window 8.1.
>>
>>
>> On 4/16/2015 11:43 AM, Mike Bonner wrote:
>>
>>> Looks like setting the folder to read only does NOT make it impossible to
>>> write into the folder. If you use the properties dialog, that is not the
>>> case, so using attrib is the way.
>>>
>>> On Thu, Apr 16, 2015 at 9:41 AM, Mike Bonner <bonnmike at gmail.com> wrote:
>>>
>>>   h is the hidden attribute. so +h should hide it.  Weird.  Going to try it
>>>> real quick (win 7)..
>>>>
>>>> Ok. I got the attribs to set by doing them one at a time.  Not sure why 2
>>>> at once doesn't work.
>>>>
>>>> I also read that the folder must be set to read only.
>>>>
>>>> SO I did attrib +r to the folder and poof. Icon.
>>>>
>>>> On Thu, Apr 16, 2015 at 3:20 PM, Ray <ray at linkit.com> wrote:
>>>>
>>>>   Mike - I've eliminated all spaces in the path but thanks, that's always
>>>>> a
>>>>> good thing to check.
>>>>>
>>>>> At this point nothing I do flips the Attributes from "A" to "HSA". I've
>>>>> changed the minus to a plus sign and tried Klaus' concatenation syntax
>>>>> but
>>>>> still no change in the Attributes.
>>>>>
>>>>> Maybe I should also be changing the visibility of the file first. When I
>>>>> set the folder icon manually the system does that.  Do you know of a
>>>>> way to
>>>>> change visibility via the shell function?
>>>>>
>>>>> On 4/16/2015 11:05 AM, Mike Bonner wrote:
>>>>>
>>>>>   oh yep, and as klaus says, if theres a space somewhere in the path,
>>>>>> you'll
>>>>>> need to force quotes around it, or use shortfilepath() to obviate the
>>>>>> need.
>>>>>>
>>>>>>
>>>>>> On Thu, Apr 16, 2015 at 9:03 AM, Klaus major-k <klaus at major-k.de>
>>>>>> wrote:
>>>>>>
>>>>>>    Hi Ray,
>>>>>>
>>>>>>> did you try with QUOTES?
>>>>>>>
>>>>>>>    Am 16.04.2015 um 23:00 schrieb Ray <ray at linkit.com>:
>>>>>>>
>>>>>>>> Klaus - thanks for the idea.  Just to check my method of
>>>>>>>> concatenation,
>>>>>>>>
>>>>>>>>   the exact command I'm using is:
>>>>>>>          get shell("attrib -HSA "&desktopIniPath&"")   -- where
>>>>>>>>   desktopIniPath is the path to the file
>>>>>>> get shell("attrib -HSA "& QUOTE & desktopIniPath & QUOTE)
>>>>>>>
>>>>>>>    It doesn't work and I see no change in the file's Attributes, Type
>>>>>>> or
>>>>>>> Size.  Livecode returns nothing in the result.
>>>>>>>
>>>>>>>   ...
>>>>>>>>   Best
>>>>>>> Klaus
>>>>>>>
>>>>>>> --
>>>>>>> Klaus Major
>>>>>>> http://www.major-k.de
>>>>>>> klaus at major-k.de
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> 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
>>>>>
>>>>>
>>>>   _______________________________________________
>>> 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