Create New Folder

tivonrice's picture

Hi...

...curious if there is an easy way to make a new folder at a specific path from QC?

I'm using NI Image Exporter, and it would be useful to dynamically generate and name new folders as I download images from the web...

Thoughts?

Not sure if something like the command line tool would work for this?

Cheers! Tivon

smokris's picture
Re: Create New Folder

Yes, use CommandLineTool.

yanomano's picture
Re: Create New Folder

Sorry to be an idiot but commandLineTools doesn't compile on my 10.6.3 any idea? Run and build and run stay grey...

cybero's picture
Re: Create New Folder

Make sure you do exactly the following whilst leaving the Project SDK as 10.5. In short download the code, unzip and do only as directed below, then Action/ Reveal in Finder, double click on the plugin and KinemeCore will install it for you, manually it should go into ~/Library/Graphics/Quartz Composer Plug-Ins

Quote:

Open the project using the Xcode editor which can be found in /Developer/Applications. From the main menu, choose "Project", set "Active Configuration" to "Release", and "Active Target" to "Build & Copy".

These settings are also available from the top left corner of the 'Overview' pop-up window. Build the project. Once the build has completed successfully, the plug-in can be used as a regular QC patch in the Quartz Composer editor (also installed under /Developer/Applications), by selecting it from the Library - Plugin panel.

From the project ReadMe, which I've just this moment followed and now have a functioning CommandLineTool plugin.

Hope that helps :-)

yanomano's picture
Re: Create New Folder

Thx cybero but i can't manage to un-grey the build buttons ! Setting Active achitecture to i386 doesn't help anymore...

PreviewAttachmentSize
Xcode_greyBuildButtons.png
Xcode_greyBuildButtons.png76.68 KB

cybero's picture
Re: Create New Folder

Try this build out. Hope that helps :-) .

PreviewAttachmentSize
CommandLineTool.plugin.zip19.09 KB

yanomano's picture
Re: Create New Folder

Yes that will helps for this plug However i'am wondering why i can only build my custom plugins with 10.6 and some of the apple developer ones doesn't compile on my system ....i have to trash the Xcode prefs probably ;)

cybero's picture
Re: Create New Folder

Keeping backwards compatibility and achieving working effectiveness on 10.6.x needs some nifty footwork from time to time.

Glad that plugin works for you.

tivonrice's picture
Re: Create New Folder

Cool... thanks!

I compiled CommandLine Tool just fine, but I'm not having much luck getting mkdir to work...

Not quite sure how to use the arguments & 'standard in' with CommandLine Tool.

Any tips?

Cheers... T

tivonrice's picture
Re: Create New Folder

Ah!

Nevermind... Just figured out the proper arrangement of arguments

bin/mkdir users/tivon/desktop/testfolder /

Thanks all!

T

smokris's picture
Re: Create New Folder

Path should be set to /bin/mkdir. Use 2 arguments, -p and your folder path.

See attached composition, which should produce a folder on your desktop.

PreviewAttachmentSize
CommandLineTool-mkdir.qtz3.05 KB

usefuldesign.au's picture
Re: Create New Folder

This plug-in compiles on Leopard too — despite the 10.6 specification.

Strangely each time I stop and run the comp, the billboard doubles in height…

I've never seen this before. I even re-noodled it with a width noodle and set the billboard to Auto-height and so on but still has this quirk...

PreviewAttachmentSize
commandlinetool.jpg
commandlinetool.jpg28.06 KB

gtoledo3's picture
Re: Create New Folder

There are a few core image filters that don't execute correctly in QC (pretty much anything that is "cismallblahblahblah", that after QC has been run with them, the Viewer does weird things like this, and won't stop until total stop and restart of QC... I've seen it happen with a handful of 3rd party plugins (usually after some weird exception).

You're in 64 bit mode with the QC.app? (It's running solid for me, but then again, I'm using 32-bit build, and QC4 in 32 bit at the moment...).

EDIT: SAME HERE ;-) After stopping it and starting it after a lengthy delay, the whole image was roughly twice the size expected. Weirdness afoot.

tivonrice's picture
Re: Create New Folder

Yep... I'm totally getting the same problem. Screen gets all stretchy.

Odd.

T

usefuldesign.au's picture
Re: Create New Folder

I tried restarting QC also (because that's often my first debug these days) but all it does is reset the billboard to the original size — the doubling still occurs after a stop/run sequence.

"cismallblahblahblah"?!

I'm Leopard (QC3) btw.

cwright's picture
Re: Create New Folder

with errors like that, there's likely context/state corruption, or memory corruption. I'd be really careful, check the logs, and see if I could narrow down what's happening before trying to depend on any of that.

usefuldesign.au's picture
Re: Create New Folder

So you think it's the plug-in that's the source of madness, cwright?

cybero's picture
Re: Create New Folder

The plugin was originally rolled out for Leopard .

This redraft might work for you, it certainly works for me on 10.6.x as in writes a directory but doesn't resize ever.

PreviewAttachmentSize
CommandLineTool-mkdir-no-resize.qtz3.61 KB

gtoledo3's picture
Re: Create New Folder

Hmm, seems doubtful that a change to a qtz is going to correct a problem with the plugin...

I've had the problems when using the standard out. The resize weirdness in that instance may show other underlying corruption issues (?). I guess it's "buyer beware" ;-)

cybero's picture
Re: Create New Folder

Actually I hate to contradict myself, but it was working and when I downloaded what I'd uploaded and ran it again it reproduced the same problem.

Definitely a sign of some underlying issue and odd behaviour indeed. :-)

tivonrice's picture
Re: Create New Folder

Its not ideal, but one workaround that works is to have the CommandLineTool in a separate composition, and use CompositionImporter...

It works, and it doesn't distort the image.

Thanks, all!

T

cybero's picture
Re: Create New Folder

That's a useful tip tivonrice.

gtoledo3's picture
Re: Create New Folder

I'm still dubious ;-) I would keep a close eye on things. With a composition loader, everytime you restart it seems to be somewhat equivalent to actually closing/opening a composition... it might be an effective bandaid, but QC might still be in an "insane" state.

It would be interesting to get to the root of the problem, because it's a useful patch.

-George Toledo

usefuldesign.au's picture
Re: Create New Folder

gtoledo3 wrote:
I'm still dubious ;-)... It would be interesting to get to the root of the problem, because it's a useful patch.

Yeah is a useful plug-in but underlines how much even a non-skanky plug-in can mess with the QC house-o'-cards if something is amiss.

Another work around might be to put the patch another arms length away might be to have the Write directory patch in a separate composition and trigger it remotely via Franz's new structure exporter patch 1024 Network plugin or Kineme's Spooky patches (which maybe have there own issues, but been okay for me) or OSC or Broadcaster Patch.

Comparing the later three, Spooky seems fastest and most reliable, although speed isn't an issue for writing a directory I guess. OSC seems to be buggy when sending a 'write' trigger either as Bool or Float (both with a pulse or 0.5 sec HIGH state tested), but string is fine.

gtoledo3's picture
Re: Create New Folder

That is so weird that I signed that message up above, I think I was semi-comatose after eating too much sushi...

In my experience, some of the Apple Developer Plugin examples are, sadly, most likely to result in some kind of "insane" state (and standard API plugins), whether it be in the Editor, the OS, weird aberrations in the output of the Viewer, etc.

This is interesting. I've triggered the condition again. The pixel w/h out of an image with string, to a billboard set to realsize is 477x375 before and after the composition corrupts into "big size" mode. Disturbing. Nothing in Console. Unconnecting/reconnecting the node makes no difference nor does stopping restarting the composition....hmmm. When I stop for awhile and then restart yet again, it's MEGA big x 2.

gtoledo3's picture
Re: Create New Folder

I just figured out a way to trigger it 100% reliably.

It's closing the Viewer and then making a new View window again while the composition is still loaded, and then running. Everytime the window is closed, then reopened, it makes the output run at what looks like about 2x larger.... so when I made the comment earlier about "waiting" it may have been because I closed the Viewer and reopened (or, waiting long enough may trigger it as well?).

mattgolsen's picture
Re: Create New Folder

I've run into all of these problems that people have mentioned about this plugin, and one more.

Try using "ping" with it. Not a good idea. Since ping provides a continuous output, it hangs the viewer indefinitely. I'm not really sure what the technical reason is for this. I'd imagine it has something to do with threads, and executing inside QC.

cwright's picture
Re: Create New Folder

mattgolsen wrote:
I'd imagine it has something to do with threads, and executing inside QC.

Close, but not quite; threads are for the same process (QuartzComposer.app), but launching a command-line tool is a different process (in OS parlance, QC.app's process becomes the "parent" of a "child" process -- ping, in your example). I'm guessing the plugin was written using something like popen, which probably waits for the command to complete. For commands that don't complete without intervention... well, you're done :)

The plugin could be modified to work around this, of course (by using threads, so a thread of QC.app would manage the potentially-indefinite command line process).

[sorry for getting all Operating Systems 101 on you]

[peeking under the hood, it's not using threads to execute the _run... method, so it blocks, as expected. all Cocoa-based stuff though, so no unix trickery to check out]

mattgolsen's picture
Re: Create New Folder

Hah! I knew if I threw some chum in the water I'd get a bite :D

Thanks for the explanation though, it's nice to know the innards.

jersmi's picture
Re: Create New Folder

A related question -- is it possible to use a Save/Save As UI window within QC?

cwright's picture
Re: Create New Folder

It's possible, in the sense that there's no technical reason why you couldn't. But you really shouldn't. A composition could run in a UI-less app (i.e. quicklook), and having a save panel pop up out of nowhere would be awful. Also, UI stuff needs to happen on the main thread, but many apps render QC compositions on the displayLink thread, and driving UI stuff there is a recipe for disaster. (as a counter-point, a patch could have the UI driven from the main thread, while rendering on a background thread, but then there's no guarantee that the UI's response will even be relevant once it's selected -- a composition could be rendered for a single frame (causing the save panel), and then deallocated (i.e. thumbnail generation or something), so the save panel would either flash in to and out of existence (looks windows-like) or simply stick around and do nothing (weird) or crash (bad).)

jersmi's picture
Re: Create New Folder

I appreciate the explanation, Chris.

I see what you mean by "pop out of nowhere". I was inquiring based on a scenario like: one might wish to save .plist files using Struct to/from File patches, and the Save UI would be a bit more friendly when setting up initial save locations than QC string parameter windows.

Anyway, I thought this would be a "no". Makes more sense to have the QC patch as a "child" within a "parent" app, with the app using the UI window?

cwright's picture
Re: Create New Folder

jersmi wrote:
I see what you mean by "pop out of nowhere". I was inquiring based on a scenario like: one might wish to save .plist files using Struct to/from File patches, and the Save UI would be a bit more friendly when setting up initial save locations than QC string parameter windows.

QuickTime did this exact thing in the past, and later got grilled for it (resolving data references, doing some other work, etc.).

I totally understand where you're coming from on the desire for it (I've really wanted something like it myself, to be completely honest). It's just that QC right now doesn't seem to have the proper provisions in place to make this really work as seamlessly as it really ought to.

jersmi wrote:
Anyway, I thought this would be a "no". Makes more sense to have the QC patch as a "child" within a "parent" app, with the app using the UI window?

depending on how you measure "makes more sense", yes and no :). It's definitely the right way to do it, but I have to admit it feels clunky to need to write an app to glue the interface and the composition together.

jersmi's picture
Re: Create New Folder

Okay, thanks so much. Feel like I learned a lot as usual!

dust's picture
Re: Create New Folder

you can use my apple script plugin to make folders etc... you can even do pop up ui elements from in qc. have not tried in quartz builder or iTunes yet. if you try with apple script or shell cmd make sure to turn the patch off after you send the cmd as the plugin executes every frame.

usefuldesign.au's picture
Re: Create New Folder

Was wondering if that Applescript plugin got fully finished. Good news, i'll try making save and restore structure presets dialogues.

ginsu777's picture
Re: Create New Folder

i have been following this thread and trying the various solutions. I am still stuck.

The terminal commands I am trying to get "entered" by QC need to be spread across 2 windows. the resultant output streams XML output -- so its more like a ping as you were saying. but I am going to be stripping off all the data but the last few characters.

Anyway, Here is what I want to do in QC -- it works great in terminals. open terminal one, enter: quarqd

then open terminal window 2. enter TWO commands from my home directory (~USER):
nc localhost 8168 /// then i want to wait 2 seconds X-set-channel: 0h

I then want to feed the output from terminal window 2 into my string truncate deal and all that, then display the last few characters of the changing data. Each line which looks like this:
<>

I got this working before, but I think this could work for me, but I just cant figure out how to get it going. The BUILD things were also greyed out in my xcode as well.

jersmi's picture
Re: Create New Folder

Using the Command Line Tool, how could one trigger the creation of a new folder with a key press?

Edit: attached is a comp which does the job with a multiplexer. However, the size issue is still present (used cybero's no-resize comp as starting point), and the triggering to the counter with the keyboard is unreliable for me. Trying different combos of key press with Pulse / Watcher / Signal. (In fact earlier I was having the same issues in another comp with the counter not increasing with keypresses... I'm restarting my computer...)

Edit2: after restart, yes, it seems buggy going from keyboard directly to counter in this comp. increasing signal stays on with key press, when it seems it should go false when key goes false. The attached comp's setup is the only thing that works for me -- using key press with Signal to counter and key press with Watcher to Pulse to multiplexer. Seems strange to me...

PreviewAttachmentSize
CommandLineTool-trigger_mkdir.qtz5.84 KB

deetox10's picture
Re: Create New Folder

I wanted to share this with you :

http://kineme.net/forum/Discussion/Programming/BetterCommandLineTool

I made little improvements of the command line tool (to stop the bug and to allow enabling/disabling).

Have Fun.

DeeToX.

monobrau's picture
Re: CommandLineTool

I'm trying to make a composition that acts as a watchdog for a couple of processes I've got running. I figured that the command line patch would be useful. The applescript patch can do this, but there isn't a patch available (or is there?) that outputs the feedback I need as well. The BetterCommandLineTool still gives the same error as the earlier variations, the composition goes blank after a few polls, and stop/restart distorts the viewer output height.

When I make an app out if it using quartzBuilder It quits with this error after a time:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSConcreteTask terminationStatus]: task still running'

Anyone got suggestions on how to do this?

Thanks!

PreviewAttachmentSize
CommandLineTool Test.qtz3.53 KB