How to get a Filetype of a specific file on PC

Aug 21, 2007 at 11:15pm

How to get a Filetype of a specific file on PC

I need a very basic object and wondering if anyone can help. I just want to check what the filetype of a particular file is.

I know that Jeremy has an object out for Mac that checks and changes – all I need to do is check – but it has to work on PC and Mac.

Some of the work I can do using the output of Dropfile – I’ve tried intricate ways of using folder to create a list that I check against – but what I really need is an object that you send a file path to and out comes its 4 letter filetype.

I’d prefer not to use JS.

If anyone can help that would be great. I’ve checked the archives and nothing came up for PC.

Stefan

#33356
Aug 22, 2007 at 9:15am

#111022
Aug 22, 2007 at 11:33am

Hi.
Even with JS, the only fileformats available are the ones listed in
max-fileformats.txt, am I right ?
So, maybe you could put this fileformats list into a coll, and cropping file
name to have corresponding 4 letters filetype ?

(example with 5 types)

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#N vpatcher 25 70 288 358;
#P window setfont “Sans Serif” 9.;
#P newex 50 71 36 9109513 t l l;
#P newex 50 113 36 9109513 zl slice;
#P newex 76 92 45 9109513 zl sub 46;
#P newex 76 134 40 9109513 itoa;
#P newex 76 155 75 9109513 prepend symbol;
#P newex 76 197 63 9109513 route symbol;
#P newex 50 50 40 9109513 atoi;
#N coll myfileformats 1;
#T flags 1 0;
#T store js TEXT;
#T store wav WAVE;
#T store pct PICT;
#T store fxp AFxP;
#T store dll aPcs;
#P newobj 76 176 93 9109513 coll myfileformats 1;
#B color 14;
#P inlet 50 30 15 0;
#P outlet 76 221 15 0;
#P connect 1 0 3 0;
#P connect 3 0 9 0;
#P connect 9 0 8 0;
#P connect 9 1 7 0;
#P connect 7 0 8 1;
#P connect 8 1 6 0;
#P connect 6 0 5 0;
#P connect 5 0 2 0;
#P connect 2 0 4 0;
#P connect 4 0 0 0;
#P pop;
#P newobj 88 144 85 9109513 p crop_file_format;
#P message 199 101 203 9109513 “C:/Program Files/Vstplugins/iZotope
Trash.dll”;
#P message 185 83 196 9109513 “C:/Program Files/Cycling ’74/mypicture.pct”;
#P message 159 64 84 9109513 D:/myfiles/blibli.js;
#P message 127 46 100 9109513 D:/myfiles/bloblo.wav;
#P message 88 195 57 9109513;
#P newex 88 169 57 9109513 prepend set;
#P message 88 27 97 9109513 D:/myfiles/blabla.fxp;
#P connect 6 0 7 0;
#P connect 5 0 7 0;
#P connect 4 0 7 0;
#P connect 3 0 7 0;
#P connect 0 0 7 0;
#P connect 7 0 1 0;
#P connect 1 0 2 0;
#P window clipboard copycount 8;

#111023
Aug 22, 2007 at 4:19pm

Thank you,

A nice elegant solution. If I use this on the PC version I should be able to catch almost all of the filetypes I need and can stick to Jeremy’s object for mac.

Stefan

#111024

You must be logged in to reply to this topic.