PDA

View Full Version : FilePreOpen/FilePreOpenProcess not working...


Malkalypse
07-08-2012, 09:15 PM
EDIT: Sorry, my mistake, I figured it out...
--
Not sure what's going on. I was having a problem with getting a filePostOpen callback to run, and after repeated repeated failures wrote up the following:
fn testFunction = (format "Testing\n")
callbacks.removescripts id:#postOpenCB
callbacks.addscript #filePostOpen "testFunction()" id:#postOpenCB
saved it as "test.ms" in my stdplugs/stdscripts folder, and restarted Max.

Nothing happens. I try opening a new file. Nothing happens. I've tried replacing #filePostOpen with #filePostOpenProcess. Still nothing. Am I doing something wrong?

denisT
07-08-2012, 09:28 PM
probably there is another script on your machine that removes your callback script after been added...
try my snippet by putting it as .ms file in stdscripts.

fn _myFileCallback event: =
(
n = callbacks.notificationParam()
format "%: file:\"%\" notification:%\n" event maxfilename n
)
callbacks.removescripts id:#_my_file_callbacks
callbacks.addscript #filePreOpen "_myFileCallback event:#filePreOpen" id:#_my_file_callbacks
callbacks.addscript #filePostOpen "_myFileCallback event:#filePostOpen" id:#_my_file_callbacks
callbacks.addscript #filePreOpenProcess "_myFileCallback event:#filePreOpenProcess" id:#_my_file_callbacks
callbacks.addscript #filePostOpenProcess "_myFileCallback event:#filePostOpenProcess" id:#_my_file_callbacks

Malkalypse
07-09-2012, 04:26 AM
It was my own mistake, but thanks anyway!

denisT
07-09-2012, 04:55 AM
It was my own mistake, but thanks anyway!
no excuse... it's your fault, and have to answer for this.

CGTalk Moderation
07-09-2012, 04:55 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.