Search Results

Search found 4 results on 1 pages for 'seld'.

Page 1/1 | 1 

  • Basic C++ Speed (initialization vs adding) and comparison speed

    - by seld
    I was curious if anyone knows which of the following executes faster (I know this seems like a weird question but I'm trying to shave as much time and resources as possible off my program.) int i; i+=1; or int i; i=1; and I also was curious about which comparison is faster: //given some integer i // X is some constant i < X+1 or i<=X

    Read the article

  • Scripting Bridge generates error creating a new playlist in iTunes on 10.5, but not 10.6

    - by Simone Manganelli
    I'm having a problem with the Scripting Bridge framework in 10.5. Specifically, I use this code to create a new user playlist in iTunes: NSDictionary *propertiesDict = [NSDictionary dictionaryWithObject:@"playlistName" forKey:@"name"]; playlistToReturn = (iTunesUserPlaylist*)[[[iTunesApp classForScriptingClass:@"user playlist"] alloc] initWithProperties:propertiesDict]; SBElementArray *sourcesArray = [iTunesApp sources]; iTunesSource *librarySource = [sourcesArray objectAtIndex:0]; SBElementArray *userPlaylistsArray = [librarySource userPlaylists]; [userPlaylistsArray addObject:playlistToReturn]; This code works fine in 10.6. The playlist is created correctly, and I can add songs to it later. However, on 10.5, an error is generated: Apple event:'core'\'crel'{ 'kocl':'cUsP', 'insh':'insl'{ 'kobj':'obj '{ 'want':'cUsP', 'from':'obj '{ 'want':'cSrc', 'from':'null'(), 'form':'ID ', 'seld':42 }, 'form':'indx', 'seld':'abso'($206C6C61$) }, 'kpos':'end ' }, 'prdt':{ 'pnam':'utxt'("playlistName") } }; Error Domain=SBError Code=-10014 UserInfo=0x152c8cb0 "Operation could not be completed. (SBError error -10014.)" Why?

    Read the article

  • Getting Safari document title/location with Scripting Bridge does not work in full-screen mode

    - by Mark
    I'm trying to get the URL and document title from the topmost Safari document/tab. I have an AppleScript and an objective-c version using Apple's Scripting Bridge framework. Both versions work fine for most web pages, however when I open a Youtube video in full-screen mode, the Scripting Bridge based version fails. The Apple Script works fine for "normal" and full-screen Safari windows. Can anyone see what is wrong with the Scripting Bridge code below to cause it to fail for full-screen Safari windows? Here the code (I omitted error checking for brevity): AppleScript: tell application "Safari" # Give us some time to open video in full-screen mode delay 10 do JavaScript "document.title" in document 0 end tell Scripting Bridge: SafariApplication* safari = [SBApplication applicationWithBundleIdentifier:@"com.apple.Safari"]; SBElementArray* windows = [safari windows]; SafariTab* currentTab = [[windows objectAtIndex: 0] currentTab]; // This fails when in full-screen mode: id result = [safari doJavaScript: @"document.title" in: currentTab]; NSLog(@"title: %@", result); Scripting Bridge error (with added line breaks): Apple event returned an error. Event = 'sfri'\'dojs'{ '----':'utxt'("document.title"), 'dcnm':'obj '{ 'want':'prop', 'from':'obj '{ 'want':'cwin', 'from':'null'(), 'form':'indx', 'seld':1 }, 'form':'prop', 'seld':'cTab' } } Error info = { ErrorNumber = -1728; ErrorOffendingObject = <SBObject @0x175c2de0: currentTab of SafariWindow 0 of application "Safari" (238)>; } I could not find details about the given error code. It complains about 'currentTab' which shows that the JavaScript event at least made it all the way to Safari. I assume that the current tab receives the event, but refuses to run the JS code, because it is in full-screen mode. However, why does this work for an AppleScript? Don't they use the same code path eventually? Any suggestions are greatly appreciated. Thanks!

    Read the article

1