]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/applescript.m
* ALL: releasing a few unreleased objects.
[vlc] / modules / gui / macosx / applescript.m
index 6fc5528381a48fea09f5e0719af7b9e76407a8a1..299f73639250418d9bfd4d8cb92a61908356ab23 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * applescript.m: MacOS X AppleScript support
  *****************************************************************************
- * Copyright (C) 2002-2003 VideoLAN
- * $Id: applescript.m,v 1.4 2003/07/23 01:13:47 gbazin Exp $
+ * Copyright (C) 2002-2003 the VideoLAN team
+ * $Id$
  *
  * Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
  *
@@ -41,7 +41,7 @@
 
     if ( [o_command isEqualToString:@"GetURL"] || [o_command isEqualToString:@"OpenURL"] )
     {
-        intf_thread_t * p_intf = [NSApp getIntf];
+        intf_thread_t * p_intf = VLCIntf;
         playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
                                                         FIND_ANYWHERE );
         if( p_playlist == NULL )
         {
             NSURL * o_url;
     
-            int i_mode = PLAYLIST_INSERT | PLAYLIST_GO;
-            
             playlist_Add( p_playlist, [o_urlString fileSystemRepresentation],
-                          0, 0, i_mode, PLAYLIST_END );
+                          [[[NSFileManager defaultManager] displayNameAtPath: o_urlString] UTF8String],
+                          PLAYLIST_INSERT, PLAYLIST_END );
 
             o_url = [NSURL fileURLWithPath: o_urlString];
             if( o_url != nil )
@@ -85,7 +84,7 @@
 - (id)performDefaultImplementation {
     NSString *o_command = [[self commandDescription] commandName];
 
-    intf_thread_t * p_intf = [NSApp getIntf];
+    intf_thread_t * p_intf = VLCIntf;
     playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
                                                     FIND_ANYWHERE );
     if( p_playlist == NULL )