Garage Band Files don't get listed

Want to talk about something that isn't covered by another category?

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2434
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Garage Band Files don't get listed

Post by richmond62 » Sat Feb 24, 2018 6:47 pm

One of the ways round this problem is to search for all the "things" lying around one's
Mac desktop (or elsewhere) and separate them into 2 fields: one for "things" that have suffixes, and one
for "things" that don't; then run a second routine to move all the "things" in the have-suffixes field into
a third field; and then what you have left are files-that-are-really-folders.

bogs
Posts: 1755
Joined: Sat Feb 25, 2017 10:45 pm

Re: Garage Band Files don't get listed

Post by bogs » Sat Feb 24, 2018 10:06 pm

Guess I'll have to fire up my osx'en vm, I figured if you had a file that wasn't being listed, it would show up as a folder in the previous code, and you would then *know* it is one of these mac things like you were discussing above.
Image

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5939
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Garage Band Files don't get listed

Post by FourthWorld » Sat Feb 24, 2018 10:08 pm

Mac and Windows both hide file name extensions by default.

And GaragaBand folders have an extension.

Maybe simpler to try "is a folder".
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

bogs
Posts: 1755
Joined: Sat Feb 25, 2017 10:45 pm

Re: Garage Band Files don't get listed

Post by bogs » Sat Feb 24, 2018 10:20 pm

Ok, I'm lost, want to elaborate?

Here is what I was thinking about his initial post -
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.
So, you have something that *looks* like a file, but doesn't list in 'the files' function (where he was pulling tFiles from).

My thinking was if you saw something like that, you would drop that folder into the path and separate out both folders and files, if you see the name of what your trying to look at in "folders" section, it tips you off so to speak that it is not going to be a file.

This is the test I'd run if something doesn't act like what it appears to be, not if I know ahead of time what it is (folder or file), like what our friend asked at the beginning.
Image

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2673
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Garage Band Files don't get listed

Post by mwieder » Sun Feb 25, 2018 2:27 am

To throw another wrench at the monkeys, there's also the issue of aliases, or links, or whatever your favorite operating system calls them.

To differentiate between actual files and aliases to files you can use the aliasReference() function:

local xFiles
-- set the defaultFolder to the folder you're interested in
put the files into xFiles
repeat for each line tFile in xFiles
put aliasReference(tFile) into xFile
if xFile is empty then
-- use tFile
else
-- use the linked file instead
end if
end repeat

bogs
Posts: 1755
Joined: Sat Feb 25, 2017 10:45 pm

Re: Garage Band Files don't get listed

Post by bogs » Sun Feb 25, 2018 6:11 am

mwieder wrote:
Sun Feb 25, 2018 2:27 am
To throw another wrench at the monkeys
I'd like to see you try it !
Image

Seriously, though, the code is neat. I hadn't hit that problem myself yet, but I'm sure that now that you've put that there, I will hit it just as soon as I've almost forgotten where I saw this :wink:
Image

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2673
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Garage Band Files don't get listed

Post by mwieder » Sun Feb 25, 2018 9:13 pm

JackieChan.jpg
I actually use a variation on that to allow widgets to be stored in any location, not just in the Extensions folder. And with a little more sleight of hand it's cross-platform if you identify how Windows, OSX and linux store aliases.

PaulDaMacMan
Posts: 190
Joined: Wed Apr 24, 2013 4:53 pm

Re: Garage Band Files don't get listed

Post by PaulDaMacMan » Tue Apr 03, 2018 9:44 pm

I know this is a month old but...

I think someone already mentioned Answer Folder is how you select a bundled file format (like .app, .pkg sometimes, .rtfd, .band )
EDIT: I just tested and was able to select a .band bundle file from 'answer file'

The reason these types of bundled formats exists is because it allows for resources associated with a Thing (like icons used in a .app) to be neatly packaged together with a Thing so that when you move Thing somewhere else, all of the associated resources / dependencies are move along with a Thing. This comes from Mac OS X's NEXTStep heritage and is similar to the way "Classic" Mac OS 9 and earlier would bundle resources in a special part of the file called a resource fork (along with a normal data fork that all operating systems have), this is specific to the Mac OS file system HFS/+.

Anyway if you are trying to open a GarageBand .band file bundle in LiveCode just for playback, well you can't, only GarageBand and LogicPro can. BUT, you can go into the bundle and look for any resources used inside the .band composition (folders), such as .wav .aif .mp3 and .caf files. A CAF file is a CoreAudioFormat file and it usually contains some MIDI header data with info like tempo/time signature and also, but not always, Musical Note data. I actually wrote some (rough) LiveCode scripts for converting MIDI data embedded in .CAF format loop files into normal MIDI .smf /.mid files.
Last edited by PaulDaMacMan on Tue Apr 03, 2018 11:22 pm, edited 3 times in total.

PaulDaMacMan
Posts: 190
Joined: Wed Apr 24, 2013 4:53 pm

Re: Garage Band Files don't get listed

Post by PaulDaMacMan » Tue Apr 03, 2018 9:52 pm

BTW, IMO bundles are an extremely useful way to store things (Richard), I can edit the audio recordings used inside my .band files in an audio editor and then when I open the .band bundle in GarageBand again all those resources are updated. I don't have to worry that I linked to the wrong edited file or forget to copy it to my archives along with the composition that it goes with because it's "inside" the composition (bundle).

For what it's worth, I miss resource forks, but bundle's are the next best thing and they're compatible with non-Mac HFS file systems.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 2434
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria
Contact:

Re: Garage Band Files don't get listed

Post by richmond62 » Tue Apr 03, 2018 10:34 pm

I miss resource forks
ResEditClown.png
ResEditClown.png (1.19 KiB) Viewed 310 times
I can't say I do.

PaulDaMacMan
Posts: 190
Joined: Wed Apr 24, 2013 4:53 pm

Re: Garage Band Files don't get listed

Post by PaulDaMacMan » Tue Apr 03, 2018 11:19 pm

I guess they could be a PIA, there were some benefits, like it was great for quickly scanning through large high-res images/Illustrator Files/Photoshop etc. that kept low res previews and thumbnails in their resource forks, back then displaying a poster size image could choke your system to a halt.

BTW, I just tested in LC 9.0 on Yosemite (10.10.5) and I had no trouble at all selecting a .band file from this script:

Code: Select all

answer file "pick a bundle a file"

Post Reply

Return to “Off-Topic”