Ok so this is supposed to be a little script to use ‘unpack-pbp (rev B)’ for unpacking EBOOT.PBP files for a PSP. I’m currently experiencing some problems.
set filePath to choose file of type {"PBP", "public.case-insensitive-text"} without invisibles
set unpacker to "/unpack-pbp-PPC "
set unixpath to POSIX path of filePath
do shell script unpacker & unixpath
First,
set filePath to choose file of type {"PBP", "public.case-insensitive-text"} without invisibles
is not disabling everything except PBP files, but rather disabling everything and I have no idea what to do there.
And secondly, if I pull the “of type” portion out so I can at least select something, the POSIX paths are not compatible with Terminal.
When it does,
set unixpath to POSIX path of filePath
I had it throw up a dialog with the POSIX path it created for the sake of an example and here’s what came out:
/Volumes/CHRIS EHDD/PSP/PSP Apps/daedalus_psp_R12_v150 Folder/Daedalus/EBOOT.PBP
This doesn’t work since it doesn’t have double backslashes at the spaces so it will display correctly when pasted into Terminal.
Finally, if you noticed, the filepath to the binary is on the root of my volume because once again, I have no idea how to set it to a Terminal friendly file path without having to manually type it in so I put it there for the sake of testing the script. If I can get help selecting the PBP file, I can probably use that to allow selecting the binary.
Thanks for any help you can provide!
The first bit of help is that since POSIX paths must either have spaces escaped or be single quoted, you’d do this:
set unixpath to quoted form of POSIX path of filePath
The second bit is to check that you have the right type. Run this against a typical file:
set T to do shell script "mdls -name kMDItemContentType " & quoted form of POSIX path of (choose file)
I thank you once again Adam. Your first part worked like a charm and I really should have thought of that… lol oh well. As far as the second part goes, I don’t even have that ‘mdls’ binary so I can’t use it and I’m not sure how to get it.
It only exists on Mac OS X 10.4 or later; It uses Spotlight to list “the metadata attributes for the specified file”.
Assuming then, that 10.3.9 is the system in use, can you even use “of type com.apple.something”? Was that there before?
Well err… I am on 10.4, but I’ve long since disabled Spotlight via terminal because it’s a CPU guzzling whore and my poor 600MHz G3 iMac has a seizure when Spotlight is running. :rolleyes: I guess I’m in a bit of a pickle…
You should still have mdls
on your machine…
Last login: Sun Sep 16 21:15:35 on console
Welcome to Darwin!
Chris-Owens-Computer:~ chrisowen$ mlds
-bash: mlds: command not found
Chris-Owens-Computer:~ chrisowen$
I have a similar problem with choose file of type.
I am writing a gui to the command line render engine of Maya. When I set up my app to choose file of type “MA” it does not show the .ma files. Using filebuddy I have determined that Maya is not setting the file type when it saves scenes. Using filebuddy I can select MA it the list of available file types and my app then works. What I really need is a way to choose file by creator or extension since changing the file type on several hundred maya scene files spread out on multiple drives and constantly being added to is not feasible. If this is possible please let me know. My backup solution was going to be to evaluate the extension after selecting and make a warning panel if the extension and creator does not match known types but I would rather not have to do that.
Thank You
choose file
only takes file types and uniform type identifiers, not extensions.