@@ -17,7 +17,7 @@ - (void)awakeFromNib
17
17
static BOOL beenHereAgain = NO ;
18
18
if (beenHereAgain) { return ; }
19
19
beenHereAgain = YES ;
20
-
20
+
21
21
resourcesLocations = [NSMutableArray array ];
22
22
[_scriptView setSyntaxDefinitionName: @" lua" ];
23
23
}
@@ -38,7 +38,7 @@ - (IBAction)addPreview:(id)sender
38
38
[op setPrompt: @" Add" ];
39
39
[op setAllowedFileTypes: @[@" png" , @" jpg" , @" jpeg" , @" tiff" ]];
40
40
NSModalResponse res = [op runModal ];
41
-
41
+
42
42
if (res == NSModalResponseOK )
43
43
{
44
44
self->previewLocation = op.URL ;
@@ -80,7 +80,7 @@ - (IBAction)saveButton:(id)sender
80
80
81
81
/* delete any previous versions */
82
82
[fm removeItemAtPath: widgetDirectory error: nil ];
83
-
83
+
84
84
/* create widget directory */
85
85
[fm createDirectoryAtPath: widgetDirectory withIntermediateDirectories: NO attributes: nil error: &error];
86
86
if (error)
@@ -101,9 +101,9 @@ - (IBAction)saveButton:(id)sender
101
101
[fm createFileAtPath: widgetCreator
102
102
contents: [_widgetCreatorField.stringValue dataUsingEncoding: NSUTF8StringEncoding]
103
103
attributes: nil ];
104
-
104
+
105
105
/* copy preview */
106
- [fm copyItemAtPath: previewLocation.path toPath: widgetDirectory error: &error];
106
+ [fm copyItemAtPath: previewLocation.path toPath: [ widgetDirectory stringByAppendingPathComponent: [previewLocation.path lastPathComponent ]] error: &error];
107
107
if (error)
108
108
{
109
109
NSLog (@" %@ " , error);
@@ -112,7 +112,7 @@ - (IBAction)saveButton:(id)sender
112
112
/* copy resources */
113
113
for (NSURL *resource in resourcesLocations)
114
114
{
115
- [fm copyItemAtPath: resource.path toPath: widgetDirectory error: &error];
115
+ [fm copyItemAtPath: resource.path toPath: [ widgetDirectory stringByAppendingPathComponent: [resource.path lastPathComponent ]] error: &error];
116
116
if (error)
117
117
{
118
118
NSLog (@" %@ " , error);
0 commit comments