Page 1 of 2

Garage Band Files don't get listed

Posted: Fri Feb 23, 2018 11:06 pm
by trailboss
Curious about this and think I'd learn something if I had the answer.
.jpg, .mp3, .pages, .doc ETC. all work in this script but .band files don't.
Curious to know why.


on mouseup

put empty into tfiles
set the folder to "/users/tomcole/desktop/Garage Band Folder"
set the folder to folderpath
put the files into tFiles

answer tfiles --IT'S SUPPOSED TO ANSWER THE FILE NAMES BUT WON'T FOR ANY FILES WITH A .band EXTENSION

end mouseup

Thanks,
Tom

Re: Garage Band Files don't get listed

Posted: Fri Feb 23, 2018 11:27 pm
by richmond62
I opened Garage Band for the first time ever (Mac OS 10.7.5)
and save a file called "test" to my desktop.

I ended up with 2 files; "test.band" and "test" (no suffix).

Neither of them were listed (LC 8.1.8).

The answer to this is that "test.band" and "test" are NOT files,
but folders in the same way as a Mac App is.

If you right-click on either of them you can perform a "Show package contents"
GBandFolder.png
It should have taken you no more than 5 minutes to work that out.

Re: Garage Band Files don't get listed

Posted: Sat Feb 24, 2018 3:36 am
by FourthWorld
richmond62 wrote:
Fri Feb 23, 2018 11:27 pm
It should have taken you no more than 5 minutes to work that out.
The first time I encountered a Garage Band file I'm pretty sure it took me more than five minutes to figure out it wasn't a file at all.

It never would have occurred to me that one of the most powerful tech companies on Earth couldn't figure out how to make a composite file format. The whole bundle thing barely made sense to me when the company transitioned to Mach-O format, and it's never made sense to me to expand the problem of trying to tell users (and systems) that a folder is a file by also doing that for documents.

Zip, anyone?

And to be honest, when I was starting out I spent literally two days in HyperCard seeing to figure out how to create a field from script. "DoMenu"? Not "new" or "make" or "create"? That never would have occurred to me.

Things like this are obvious only after you learn them. And learning takes different speeds for different people and different subject.

Re: Garage Band Files don't get listed

Posted: Sat Feb 24, 2018 3:39 am
by trailboss
Thanks for clearing this up for me. I appreciate your taking the time to test this for me.

I now remember that there are folders that look like files. In fact, I remember now that standalones in Runtime Rev are apps that are really folders too. I didn't think about that and so I wanted to ask about it. I appreciate knowing what went wrong. Very helpful

Item: Perhaps I'm out of line here and perhaps it's the role of a moderator and not mine to say that we all have different skill levels and areas of expertise and that's why there is a forum where people can ask questions and get assistance from others. In that light, I think you'll agree that the comment "It should have taken you no more than 5 minutes to work that out" is not as helpful as the rest of your answer.

Re: Garage Band Files don't get listed

Posted: Sat Feb 24, 2018 3:50 am
by trailboss
Oh, I now see that Richard Gaskin has also touched upon the issue I mentioned at the end of my response.

Re: Garage Band Files don't get listed

Posted: Sat Feb 24, 2018 3:51 am
by FourthWorld
trailboss wrote:
Sat Feb 24, 2018 3:39 am
Item: Perhaps I'm out of line here and perhaps it's the role of a moderator and not mine to say that we all have different skill levels and areas of expertise and that's why there is a forum where people can ask questions and get assistance from others. In that light, I think you'll agree that the comment "It should have taken you no more than 5 minutes to work that out" is not as helpful as the rest of your answer.
Agreed, trailboss. The moderators here are volunteers, so we don't always get to things as quickly as we'd life. But in this case it seems your post and mine crossed - see my last post just above yours.

If you don't mind my asking, is your screen name a hiking reference? I can't get out often enough these days, but I do enjoy a good walk for a few days when I can.

Re: Garage Band Files don't get listed

Posted: Sat Feb 24, 2018 4:08 am
by trailboss
My username is a hokey stage name because I sing western tunes along with 20s, 30s, and 40s jazz standards. I don't really like the handle (too redneck for me) but it's seems to have stuck. I've done a lot of hiking to the bottom of the Grand Canyon numerous times on numerous trails: the Hermit, the Kaibab, the Salt, etc, and also around the Superstition mountains in Arizona and elsewhere. Lots. However, my twin brother is more the hiker than I. He hikes in Chile and other places and just came back from hiking the Camino de Santiago in France and Spain. He's going back this summer there with a friend to do it again.

Re: Garage Band Files don't get listed

Posted: Sat Feb 24, 2018 4:11 am
by FourthWorld
Funny you should mention Camino de Santiago. One of our regulars walked that last year.

Glad to meet you. Welcome aboard.

Re: Garage Band Files don't get listed

Posted: Sat Feb 24, 2018 5:31 am
by bogs
Glad you got to where you needed to be, hope this can be of some help to you in the future. It is a simple script that you can either stick in a stack (I don't bother adding a button for something like this), or you can run it from the message box after setting the default folder for it to list from.

Code: Select all

on mouseUp
   answer folder "Choose a folder..." 
   if it is not empty then set the defaultFolder to it
   put "Folders - " & cr & the folders & cr & cr & "Files - " & cr &  the files into field "Field"
   filter field "Field" without ".." 
end mouseUp
You can make it fancier by doing sorts, filtering it further, or really anything you want, but often its good enough as is. What it looks like in the message box, after setting the default folder to what you want to look at -
Selection_003.png

Re: Garage Band Files don't get listed

Posted: Sat Feb 24, 2018 9:51 am
by richmond62
Things like this are obvious only after you learn them. And learning takes different speeds for different people and different subject.
Undoubtedly.

BUT: if one knows Mac OS X's "kinky tendencies" [i.e. the 'funny' folders that pretend to be applications]

& that .band files are not showing up . . . the reasonable conclusions are:

1. LiveCode is allergic to .bandfiles, which makes no sense at all.

2. A .band file is not what it seems.

Re: Garage Band Files don't get listed

Posted: Sat Feb 24, 2018 9:52 am
by richmond62
not as helpful as the rest of your answer
Whatever gave you the impression I was trying to be helpful? :D

Re: Garage Band Files don't get listed

Posted: Sat Feb 24, 2018 5:01 pm
by trailboss
on mouseUp
answer folder "Choose a folder..."
if it is not empty then set the defaultFolder to it
put "Folders - " & cr & the folders & cr & cr & "Files - " & cr & the files into field "Field"
filter field "Field" without ".."
end mouseUp

This code will save me a lot of time. I can just alter it to have it put the file names in a field. I already have different buttons to click to create html files so I can quickly make web pages.

So if the selected fld contains one file: Graveyard Itasca 2009.jpg, I can turn that into handy html code for anything—in this case a thumbnail-sized picture with a link to the full-sized one.

<a href="Graveyard Itasca 2009.jpg"><img style="border: 0px solid ; width: 400px; height: 250px;" alt=" "src="Graveyard Itasca 2009.jpg"></a><br>Graveyard Itasca 2009.jpg<br>

Then I just paste it into my html document. If there are lots of image files in the selected folder, it saves even more time.

Thanks
Tom

Re: Garage Band Files don't get listed

Posted: Sat Feb 24, 2018 5:38 pm
by bogs
Glad it helped you :)

Like I was saying earlier, you can extend that quite a ways, for instance by sticking the folders or the files into a tmpVariable first, you can do all kinds of stuff to them, formatting, setting pictures into fields, filtering more efficiently, etc.

As a simple example, I used it as the basis for this field -

Re: Garage Band Files don't get listed

Posted: Sat Feb 24, 2018 5:39 pm
by richmond62
One of the problems with Apple's "farting around with folders masquerading as files" is exactly the problem you encountered: how either LiveCode or "simple" end-users like Thee and Me can work out what is a folder or a file on first sight.

Re: Garage Band Files don't get listed

Posted: Sat Feb 24, 2018 5:55 pm
by bogs
Yah, that can be problematical.