Compify

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

I'm working on a script that someone requested on here. It makes comps out of footage items in your project. I'd like to have it pull some settings out of preferences for the still images. When you grab a still image and drag it to the new comp button, it makes the duration and frame rate the same as the last comp you make(I think). Where is that setting stored? I looked through the prefs but didn't see anything.

Thanks.
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

I have a new problem now I think. I made a whole dialog for the script, solving my earlier problem. Now I am getting erratic results, for instance, it will work correctly the first time, and then it won't add the suffix text in subsequent tries. Do I need to clear out my variables or something? I'm a fried on it now, maybe in the morning I can figure it out.
Anyone care to take a look at it and see if you can spot the errors? It's over in the scripts library.

Thanks.
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Did you manage to figure this out? I spent some time on the script last weekend but couldn't work it out either. It didn't seem like it ever put the suffix on the new comp name.

First I changed the default suffix from nothing to "test" using:
dlg.sufEt = dlg.add('edittext', [55,5,195,25], 'test' ) ;
which proved that it was adding the suffix to the comp, just not updating the variable if you changed it in the dialog.

I tried simplifying your variable definitions by changing things like:
dlg.btnPnl.buildBtn = dlg.btnPnl.add('button', [3,3,48,23],'OK', {name:'ok'});
to:
var buildBtn = btnPnl.add('button', [3,3,48,23],'OK', {name:'ok'});
which seems to be equally valid, but didn't solve the problem.

I tried various other things, but nothing seemed to work. Then the solution just kinda popped into my head a few days later. I've just tried it and it seems to work, so in case you haven't figured it out yet....it looks like your script is misbehaving because you didn't put a Cancel button on your dialog. Well, you did but it was commented out.

The crazy world of scripting eh?

Paul T
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

That's very strange. No I haven't figured it out and have been having trouble on my dialogs lately. What do you put in for a cancel command? I'm getting stuck on what the method is to jump out of a function when you click on cancel.

Thanks Paul.
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Basically I just removed the //'s from the line that created the Cancel button and the suffix thing started working properly.

Regarding the Cancel button, if buttons are called 'ok' or 'cancel' they are automatically recognised as those particular buttons (I don't think you even need the {name: "ok"} bit). See page 206 of AE6.5 scripting guide.

dlg.show() returns whether you ok'ed or cancelled out of the dialog, so you might use something like:
if(dlg.show() !=1){
var canRunScript = false;
}


or maybe:
if(dlg.show()==1){
sort out all your variables and return them
}

So if you cancelled, this would (I think) mean null was returned. If null was returned by the createDialog() function, you make it so your script stops running.

Paul T
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

I think I have COMPIFY.jsx working now. The cancel button doesn't do anything and it reports the wrong number of comps. (Any Ideas?)

Thanks for your help. That's very strange that the dialog acts funny just because you don't have a Cancel button.

I'm still getting my head around how to do the cancel button. I think I need to set my variables globally instead of just in the function. That way I can use the dlg.show in the return.

I'll keep chugging and see if I can get it to work. I've got another script almost ready once I get the cancel thing worked out.
Impudent1
Posts: 57
Joined: June 12th, 2004, 6:40 pm

hmm I havent looked at your script but I would say you could take a peek at the muster batch submit script I made. In that I had to do a -1 to the returned number of queued objects, so perhaps you have to just shuffle your index back or forward by one?
Post Reply