This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Chris Keith
Posted May 15 - Read on Facebook

is there a way to get the number of files in a specific folder or directory using coffeescript?

5 Comments

Trevor Phillippi

Could you elaborate more on your use case?

Trevor Phillippi

FWIW, coffeescript just compiles to javascript which is runs in a browser or Framer's webview, so it doesn't have direct access to the file system outside of looking up a specific resource (e.g. "images/img1.jpg"

Chris Keith

I was trying to look into a folder and see how many image files there were then run a for loop to store the names of those images as strings in an array

Trevor Phillippi

You could try adding jQuery to your project (via ProjectName.framer/index.html) and try something like the ajax technique outlined here, but instead of adding <img> elements to the page, you'll be pushing to an array http://stackoverflow.com/questions/18480550/how-to-load-all-the-images-from-one-of-my-folder-into-my-web-page-using-jquery

Chris Keith

This looks like it might work. Thanks!

Read the entire post on Facebook