@mgate said:
require 'ftools.rb' > ... > folder = File.dirname( __FILE__ ) > resources = "Resources" > resource_name= "XXXXXX AT Template.skp" > resource_file = File.join(folder, resources, resource_name).tr("\\","/") > ... >Problem here.
The "Resources" folder is not in a sub-folder of the "Plugins" folder, nor in a sub-folder of YOUR extension sub-folder (which should be in a sub-folder of "Plugins".)
This should return the correct path:
resource_path = Sketchup.find_support_file("Resources")
The above script certainly creates the copy in the correct folder but SU crashes afterwards.[/quote]
Do you get a BugSplat!, or is a Windows Error Report (WER) generated (ie, check Event Viewer) ?
Secondly, your rescue clauses are not telling you what error is happening. Do something like this:
begin # file operation rescue => e puts e.inspect # or UI.messagebox(e.inspect) else # change to more meaningful message; puts "file operation success!" endThirdly, we used to tell users to run SketchUp as administrator because all users needed read and write permissions on folder in the SketchUp application's program path. (This can cause file drag and drop to stop working for SketchUp.)
The alternative is to set permissions for SketchUp and all it's program sub-folders to allow all users full permissions.