I was curious, is it possible to exclude the addHookAfter("saved") from running when copying pages. I have a function (currently running in ready.php) that runs on page save for certain templates.
$pages->addHookAfter('saved', function($event) {
$page = $event->arguments[0];
if($page->template->name == 'dev'
....
The function basically just adds the page title to a csv using fwrite if the name does not exist yet. This is functioning great, however, it also runs when copying the pages which produce some unwanted results, ie:
dev-page
dev-page-1 (the title of the copied page before I have a chance to rename the title and name).
I end up with a bunch of *-# pages, as well as the new page names/titles. Is it possible to somehow get around the copying also running the function?