Creating attribute sets and attributes programatically magento
- by digital_paki
I am using the code listed on the following link =: 
http://www.magentocommerce.com/wiki/5_-_modules_and_development/catalog/programmatically_adding_attributes_and_attribute_sets
Everything works until the point: 
    // Just add a default group.
    else
    {
        $this->logInfo("Creating default group [{$this->groupName}] for set.");
        $modelGroup = Mage::getModel('eav/entity_attribute_group');
        $modelGroup->setAttributeGroupName($this->groupName);
        $modelGroup->setAttributeSetId($id);
        // This is optional, and just a sorting index in the case of
        // multiple groups.
        // $modelGroup->setSortOrder(1);
        $model->setGroups(array($modelGroup));
    }
I am unsure where the object reference would need to be set from - I am attempting to have this as a separate file that can be automated - I am running this file by doing a 
require_once 'app/Mage.php'; 
Mage::app(); 
Any help in this would be greatly appreciated 
Thanks