Page 1 of 1

Want to Make an Index for My Web Page

Posted: Thu Oct 23, 2014 5:51 am
by trailboss
I have a web page with lots of stuff in it. I want an index of all the files in it so you can see at a glance what's in it and go to pages fast.

So, I'd like to have RunRev look into a folder named, say: allmywebpagefiles and import a list of all the file names.

Then I could alphabetize them and stick them onto an html document so I could navigate in a new way by clicking:

adobebuilding.html
dogs.html
houseondrurylane.html
myguitar.html
yosemitepark.html
zamoramexicotrip.html

Someone showed me how a long time ago, but I can't remember.

Thanks,
Tom

Re: Want to Make an Index for My Web Page

Posted: Thu Oct 23, 2014 6:42 am
by FourthWorld
See the"files" function in the dictionary.

Re: Want to Make an Index for My Web Page

Posted: Thu Oct 23, 2014 6:46 am
by trailboss
Ah, I see this:

put the files into field "Current Files"
repeat with x = 1 to the number of lines of the detailed files
put the files & the folders into diskContents[the defaultFolder]

But how to I point it to the folder "allmysitefiles" or something.

I'm not very good at this. Has to do with the defaultFolder I should think.

Tom

Re: Want to Make an Index for My Web Page

Posted: Thu Oct 23, 2014 11:50 am
by Klaus
Hi Tom,

...
set the folder to "path/to/your/folder/allmysitefiles"
put the files into tFiles
...
"folder" is a shortcut for "defaultfolder" :D


Best

Klaus

Re: Want to Make an Index for My Web Page

Posted: Thu Oct 23, 2014 2:49 pm
by FourthWorld
Klaus' post is very helpful. The only thing I would add is that you can let the user select a folder with the "answer folder" command.

And if you're dealing with folders at fixed locations, the specialFolderPath function may help for locating a good many specific folders on each OS.

Re: Want to Make an Index for My Web Page

Posted: Thu Oct 23, 2014 4:22 pm
by trailboss
It works! I just wrote:

on mouseup
set the folder to "/users/tomcole/Backup Google Drive/more web Material/"
put the files into tFiles
put tfiles into cd fld "filelist"
end mouseup

Now I can have a huge list and you can search it and click to extract any specific sheep from the entire herd of sheep and goats and go to it at once.

Thank you very much!

Tom

Re: Want to Make an Index for My Web Page

Posted: Thu Oct 23, 2014 7:43 pm
by Simon
Hi Tom,
I'm glad to hear it's all working for you but wanted to give you a tip that may save you some headaches in the future.
Watch out for spaces in your paths, "Backup Google Drive/more web Material", urlEncode will fix it for you.
Nothing for you to do now but one day....

Simon

Re: Want to Make an Index for My Web Page

Posted: Thu Oct 23, 2014 7:48 pm
by trailboss
Thanks Simon.

Re: Want to Make an Index for My Web Page

Posted: Thu Oct 23, 2014 9:22 pm
by Klaus
HI Tom,

you can save some typing by overcoming old HC habits:
HC: put tfiles into cd fld "filelist"
LC: put tfiles into fld "filelist"

Spot the difference :D


Best

Klaus

Re: Want to Make an Index for My Web Page

Posted: Fri Oct 24, 2014 4:33 pm
by trailboss
How did you know I was so old? :D It's nice to know that I belong to an exclusive group that knows abbreviations like HC.

Back to topic:
However, answer fld "filelist" gets me nothing.
Neither does answer bg fld "filelist"
But answer cd fld "filelist" seems to work.

Long live Bill Atkinson!

Tom

Re: Want to Make an Index for My Web Page

Posted: Fri Oct 24, 2014 5:03 pm
by Klaus
Hm, just made a test with LC 6.7 and -> answer fld "Field1"
did actually work on OS X 10.10!

What version are you using?

Re: Want to Make an Index for My Web Page

Posted: Fri Oct 24, 2014 11:27 pm
by trailboss
Oh, I have the new stuff, but I'm still using Studio 2.8.1 for many things.