folders() does not return aliases to folders?

Chris Heidecker hechris at ziggo.nl
Sun Jun 19 06:19:14 EDT 2022


A workaround to get the alias folders into the folderlist.
Maybe there is a more elegant approach?

function theFolders targetFolder
   put the defaultFolder into oldDef
   set the defaultFolder to targetFolder
   put the folders into folderList
   put the files into fileList
   repeat for each line theFile in fileList
      put the aliasReference of theFile into theAlias
      if theAlias is not empty then
         if there is a folder theAlias then
            --answer "the path to: " & theAlias
            put return & theFile after folderList
         end if
      end if
   end repeat
   set the defaultFolder to oldDef
   return folderList
end theFolders

on mouseUp
   answer folder "Choose a folder with aliases to folders in it"
   put theFolders(it) into folderList
   filter folderList without ".."
   sort lines of folderList international
   answer folderList
end mouseUp

-- I set the defaultfolder and did not use folders(targetFolder) because
--  otherwise i would have to construct the filepath for the aliasreference
--  put the aliasReference of (targetFolder&"/"& theFile) into theAlias


Regards,
Chris Heidecker

> Op 19 jun. 2022, om 10:01 heeft Chris Heidecker via use-livecode <use-livecode at lists.runrev.com> het volgende geschreven:
> 
> Hi,
> 
> Aliases to foiders are missing in "the folders" function
> 
> In the Dictionary for folders:
> Aliases (on OS X systems), symbolic links (on Linux systems) and shortcuts (on Windows systems) are included in the list only if they refer to a folder.
> 
> Is it a bug or could it be my mistake?
> This is on OSX 12.4 and LC 9.6.7
> 
> 
> regards,
> Chris Heidecker
> 
> 
> _______________________________________________
> 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