Scripting Bridge and Powerpoint, how to make new slide?

I know how to make a new slide in an active presentation in Powerpoint. It works like this:
tell application "Microsoft PowerPoint"
set newSlideC to make new slide at before slide 2 of active presentation ¬
with properties {layout:slide layout media clip and text}
end tell
(I stole this snippet from http://www.mactech.com/vba-transition-guide/index-094.html)
Now I would like to do the same via Scripting Bridge in my Cocoa app.
But I seem to be unable to find the appropriate classes, objects, methods, or properties in Powerpoint.h
(which I created with this command:
sdef /Applications/Microsoft\ Office\ 2008/Microsoft\ PowerPoint.app | sdp -fh --basename Powerpoint
According to Script Editor's dictionary of Powerpoint, the "make" command is in the 'Standard Suite'.
But I have no idea how to find it's defintion, let alone how to use it from my Cocoa application.
Could somebody please give a hint to me?
Since I'm not (yet) subscribed to the applescript-users mailing list, I am taking the liberty to post my question here.
Thanks a lot in advance.
Best regards,
Gabriel.

Hello
You need to alloc and init to make an object instance in Scripting Bridge.
See the following documents.
Scripting Bridge Programming Guide for Cocoa
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ScriptingB ridgeConcepts/
Scripting Bridge Framework Reference
http://developer.apple.com/mac/library/documentation/ScriptingAutomation/Referen ce/ScriptingBridgeFramework/
Some sample codes
http://developer.apple.com/mac/library/samplecode/SBSendEmail/
http://developer.apple.com/mac/library/samplecode/SBSetFinderComment/
http://developer.apple.com/mac/library/samplecode/ScriptingBridgeFinder/
http://developer.apple.com/mac/library/samplecode/ScriptingBridgeiCal
As for your example, code would be something like this.
NOT TESTED AT ALL. AND PROBABLY IT'S WRONG IN PARTS.
Just for showing the outline, hopefully.
PowerPointApplication *powerpoint = [SBApplication applicationWithBundleIdentifier:@"com.microsoft.powerpoint"];
[powerpoint activate];
PowerPointSlide *s = [[[powerpoint classForScriptingClass:@"slide"] alloc]
initWithProperties:
[NSDictionary dictionaryWithObjectsAndKeys:
@"slideLayoutMediaClipAndText", @"layout",
nil]];
[[powerpoint.activePresentation slides] insertObject:s atArrangedObjectIndex:0];
Good luck,
H
Message was edited by: Hiroto (fixed typo)

Similar Messages

  • How to make New Document and Upload Document to have same Content Type in Document Library in Sharepoint 2010

    Hi,
    How to make 'New Document' and 'Upload Document' to have same content type(Custom) in Document Library in Sharepoint2010.
    Note : I have created custom Content Type since I have custom columns along with upload column..
    Regards, Shreyas R S

    go to library settings 
    Change new button order and default content type
    set your custom content type to be #1
    when you upload new document it will automatically have your custom content type
    Hope that helps|Amr Fouad|MCTS,MCPD sharePoint 2010

  • How to make new line in JButton.setText()?

    how to make new line in JButton.setText()?
    I want to set the text of jbutton in tow line ,as follows
    | jbutton-line1 |
    | xxxxxxx-line2 |
    i konw i can jbtton.settext("<html>line1<br>line2</html>");
    but i find it's ugly using html,
    is there anyother way to create new line in JButton's Text

    As for the above comment....
    I thought the question was well purposed. Using HTML was not acceptable in this instance, which was made clear, so why critisize his comments? "Using HTML" is a poor solution, it does NOT work in many instances due to browser, OS variations. Usually the "common answer" is never a COMPLETE answer.
    Possible Solution:
    Use JLabels to render the text on the button.
    import javax.swing.*;
    import java.awt.*;
    public class ButtonMaker {
    public static void makeButton(JButton jb, String[] titleList) {
    jb.setLayout(new FlowLayout());
    for (int i = 0; i < titleList.length; i++) {
    JLabel tmpLabel = new JLabel(titleList);
    tmpLabel.setForeground(Color.black);
    jb.add(tmpLabel);
    public static void clearButton(JButton jb) {
    Component[] cList = jb.getComponents();
    for (int i = 0; i < cList.length; i++) {
    if (cList[i] instanceof JLabel)
    jb.remove(cList[i]);
    Known Limitations:
    1. Flowlayout does not work well with single line text buttons... perhaps another layout manager may work better for various buttonsizes-linenumber combos.
    2. Mac OSX : The default UI for Mac OS X (and above it seems), is to have rounded edged buttons. These rounded edges are destoryed when using JLabels, leaving a square, blocky button in its place.
    POSSIBLE SOLUTION:
    (this is ugly and time consuming)
    - create images of the button with text on them.

  • Wanted to know how to make new mailboxes in e mail.

    Wanted to know how to make new mailbox in e mail.

    If you are on iOS 5+ and it's an IMAP type account then you should get an Edit button at the top of the list of folders that you currently have on your email account. If it's a POP type account then you won't get the Edit button, and you are limited to the folders that you currently have.

  • How to add new slides in iAD Producer?

    Hello, there!
    I am trying to producer a new slide where I can write text in iAD.
    I have problems with it though and can you please tell me how to add new slides, where I can either write text or add new objects or assets?
    Also when I try to use the CAROUSEL, I can only put it there, but once I put the asset image on it, it doesnt work - I can't place the image in the center of each boxe and it doesn't go full screen once I click on on it through my iPod Touch (5th Generation).
    Please answer me those questions and I would be very happy indeed!

    Contact the developer. You question does not seem to be related to the iPod touch. Also, there is a general's developer's forum:
    https://discussions.apple.com/community/developer_forums

  • How to make a slide bar that controls opacity

    I'm trying to figure out how to make a slide bar that would control opacity. If I were to take to pictures on top of each other, the slide bar would control the opasity of the top image. Thanks

    can you make a slider that controls anything?  if so, what's the range you can control?
    ie, when the slider is at one extreme it causes some object to have value1 and when it's at the other extreme the object has value2.  what value1, value2 can you handle?

  • Slide duration - How to make one slide have a different duration to another slide?

    Slide duration - How to make one slide have a different duration to another slide?
    EG So one slide has 2 seconds, another 4 another 6
    All I can see is how to make all slides have the same duration
    Any help very much appreciated!
    Brian

    Slide durations are not changeable on a slide-by-slide basis.

  • Hello! How to make new folders on I pad 2 .download data from net and use it offline also .

    I do not known how to make folders in I pad 2 and use them offline2.i am using this I pad 2 for the first time. I have used windows for years and is quite comfortable with windows

    Just drag one app on top of another. Here's an article about it:
    http://www.macworld.com/article/160291/2011/06/create_organize_ios_folders.html

  • Scripting Bridge and iTunes

    I'm trying to add a playlist to iTunes via some Obj-C code. (Yeah I know AppleScript would be simpler, but part of this is for me to learn coding with Cocoa.) I'm not new to coding, just the Mac flavor of it, and I suspect I'm missing something simple. Anyway, the procedure in question (from a button's click handler):
    <pre>
    iTunesApplication *iTApp;
    SBElementArray *thePlaylists;
    NSDictionary *newPlaylistProps;
    iTunesPlaylist *newPlaylist;
    iTApp = [SBApplication applicationWithBundleIdentifier:@"com.apple.iTunes"];
    if ([iTApp isRunning]) {
    thePlaylists = [(iTunesSource*)[[iTApp sources] objectAtIndex:0] playlists];
    newPlaylistProps = [NSDictionary dictionaryWithObject:@"foobar" forKey:@"name"];
    newPlaylist = (iTunesPlaylist*)[[[iTApp classForScriptingClass:@"playlist"] alloc] initWithProperties:newPlaylistProps];
    [thePlaylists addObject:newPlaylist];
    </pre>
    I've got iTunes.h created and #imported like the ADC guide showed. The code above works fine until the addObject call, at which point I get an Apple event error -10014. This seems to mean I sent in a list when the handler wanted a single object. I thought newPlaylist counted as just an object.
    Also regarding populating the thePlaylists var - I've resorted to grabbing the first source solely to simplify things. Until I hit this wall, I was iterating the sources to find the library one.
    Any help would be appreciated - thanks!

    Short answer: Scripting Bridge's design is flawed. See the 'jumpstart me with the scripting bridge' thread over on AppleScript-implementors for an explanation of this particular defect:
    http://lists.apple.com/archives/Applescript-implementors/2007/Nov/index.html
    Your options are:
    1. Work around Scripting Bridge's brokenness by sending your own 'make' Apple event via -[SBObject sendEvent:id:parameters:]. (Or even via AEBuildAppleEvent or NSAppleEventDescriptor and AESendMessage if you're particularly masochistic.) You'll need to know the raw AE codes for the 'make' command to do this; e.g. Script Editor can save an application's dictionary to .sdef (XML) file, or ASDictionary [1] can export it in a more readable plain text format.
    2. Use AppleScript via NSAppleScript. Somewhat defeats the purpose of the exercise, but AppleScript knows how to speak Apple events properly so at least you know it'll work.
    3. Use a third-party bridge that speaks Apple events the same way as AppleScript does. For ObjC, use objc-appscript [2]:
    ITApplication *itunes = [[ITApplication alloc] initWithName: @"iTunes.app"];
    NSDictionary *properties = [NSDictionary dictionaryWithObject:@"my playlist" forKey:[ASConstant name]];
    ITMakeCommand *cmd = [[[itunes make] new_: [ITConstant playlist]]
    withProperties: properties];
    ITReference *playlist = [cmd send];
    [itunes release];
    HTH
    [1] http://appscript.sourceforge.net/download.html
    [2] http://appscript.sourceforge.net/objc-appscript.html

  • How to make new RPD online

    Hi All,
    Please tell me how to make an rpd online.
    In my development environment, there is already one RPD online.
    Now I am creating another RPD and want to make it online and create a answers report based on my RPD.
    Please tell me hw to replce existing online rpd with my newly created rpd.
    I would like to know the steps..
    Environment details in my development are as below;
    I have BI server on separate server machine. The current BI server is pointing to an RPD pointing to oracle EBS datasource
    On my own laptop I have BI Admin tool installed. I am creating another rpd based on planning database (Essbase DB). I want to replace current online rpd (pointing to EBS) with my new Rpd (pointing to Essbase DB). and then create a report on Essbase datasource.
    Thanks and Regards
    Santosh

    Hi Santhosh,
    1. Intially, stop your services -> Oracle bi server, Oracle bi presentation server.
    2. Open BI Administration tool -> File -> Create new rpd -> give some name say 'test' with no physical, bmm, pres. layers.
    3. Niow - Open C:\oraclebi\server\repository ----- Here you can view your rpd (to confirm)
    4. Now - Open C:\Oraclebi\server\config ---- Here you can view 3 files
    5. Right click on Nqs Config file and open it.
    6. You will find a section called [Repository] under which by default it has Star     = samplesales.rpd, DEFAULT;
    7. Now, Comment the above one by adding '#' symbol in front of it.
    8. Within the same section write the following Star=test.rpd,DEFAULT; Save the Nqs File.
    9. Now - open C:\oraclebidata\web\catalog and create a new folder 'test' - this is catalog folder where your reports gets stored.
    10. Open C:\oraclebidata\web\config --- Open Instanceconfig file.
    By Default you can view that catalog path --- pointing to Samplesales
    <CatalogPath>C:/OracleBIData/web/catalog/samplesales</CatalogPath>
    Change it to: <CatalogPath>C:/OracleBIData/web/catalog/test</CatalogPath>
    11. Save instance config file.
    12. Restart your services - oracle bi, oracle bi presntation server and now you can also open rpd in online or offline mode (i.e. your rpd 'test')
    Thank you....

  • How to make new item show in ASCP Plan workbench.

    Item ATT.BVL3AHY is a new item without any demand. At item master, it is set as Planned so it is collected by ASCP. The item can be found in msc.msc_system_items with Plan_id -1. Plan id -1 corresponds to Collection. Planner needs to manuallty add planned order for this item at ASCP workbench of plan WIRELINE (PLAN_ID 3002) as attached but as the item cannot be found in WIRELINE plan, planner cannot add it. Please let me know how to make this item show in WIRELINE Plan workbench.

    Run this query:
    select mrp_planning_code from msc_system_items where item_name like '<Item_Name>' and organization_id = <Org id> and plan_id = -1
    If this returns 7 you dont need to run any collections.
    If this returns other than 7 then,
    create a simulation set under Item Attributes Mass Maintenance and then update the attribute MRP Planning method for this item to MRP/MPP Planning. Assign Simulation set to plan name and then rerun the plan. It should work.
    If you are still facing an issue, then raise an SR with Oracle.

  • How to make new database connection using Oracle BI Interactive Dashboards

    Hi,
    I install Oracle BI Intelligence on my system.
    I am using Oracle BI Interactive Dashboard. Here we have default database connection.
    but now i want to use it for my own database. Can any body give me guideline how to
    make a new data base connection using this s/w or how to connect to my database so
    that i can make my own reports.
    I am using
    http://www.oracle.com/technology/obe/obe_bi/bi_ee_1013/saw/saw.html
    this link.
    i make odbc connection which is fine.
    but
    Restoring the Business Intelligence Presentation Catalog and Updating Metadata
    The third point blow above heading is not clear.
    Thanks

    Umesh - in order to build Answers and Dashboard content you must first setup a Physical model, then a Business model, followed by a Presentation Catalog/Subject Area.
    All these tasks are carried out using the Repository Administration Utility.
    1) Import your physical tables using OCI/ODBC into the physical layer.
    2) Build your model
    3) Deploy
    Then you're ready to start building answers/dashboards.
    Good Luck.

  • How to make a slide show or edition including mpeg and other formats

    Hi,
    I am i bit puzzled by the use of iphoto/imovie/itunes.
    I have a Sony camera which generates jpg photos and mpg videos; besides, i have 3gp and mp4 videos from cell phones.
    Firstly, i imported all of them to iphoto. I used a automator workflow to help importing from hotsynced Palm centro files, to discover the first problem with the 3gp files: they could not be iported by workflows.
    Still, they could be seen in iphoto, but then i tried to make a slide show. My idea was to put the photos and videos of a certain event to be watched together, or at least to be able to watch the videos in a sequence, without having to click on each one.
    I didnt get it in iphoto, so i switched to imovie. it was even worse, since it cannot import the mpgs and the 3gps (the jpg photos were ok). What could i do about that? is there any converter or other way?
    then i tried the itunes, and it was the opposite: it imported and played in sequence the mpg videos, but not the photos. This is a workaround anyway, since the program expects to play movies, and makes my daughter a "star", but that`s ok, she is one to me.
    i'll be thankful for hints on how to make the imovie compatible with the 3gp and mpgs, or finding some way to do this edition in iphoto or even with itunes.
    regards

    I see, it sounds reasonable , i think i will buy the pro and try.
    QT Pro ($30) and MPEG Streamclip (free) complement each other. In many cases one can do things that the other cannot. For instance, MPEG Stramclip can handle/edit multiplexed formats while QT Pro cannot. QT Pro allows layering of data tracks while Streamclip does not. Streamclip merges file streams more easily than QT Pro but QT Pro allows the "Movie to MPEG-4" export to "passthrough" the video while Streamsclip does not. And so on and so forth...
    I was referring to the mpegs from the Sony camera, of which a have hundreds, shot in the last 3 or 4 years, mainly from my 5-year old daughter. Is the above true to these?
    That still doesn't help. By "sony camera," are you referring to a still digital camera (multiplexed MPEG-1) or a Sony video camcorder taking MPEG-4/AVCHD with AC3 audio in an MPEG wrapper, a Sony DVD/HDD camera storing some kind of MPEG-2/AC3 files. On a Mac, the extension MPG normally refers multiplexed MPEG-1 (or MPEG-1 audio layer) files while MPEG normally refers to multiplexed MPEG-2 video content with MPEG-1, layer 2 audio (MPEG2/MP2) but may also refer to files with MP3 or AC3 files in an MPEG, VOB, or TS wrapper. In addition it may loosely refer to elementary M2V video streams (M2V video file paired with a separate AIFF or AC3 file), a standard MPEG4/AAC file (in an MOV or MP4 wrapper) or a standard H.264/AAC file in MOV, MP4, or M4V wrapper). Since the handling, conversion, editing requirements vary with each type of file, it becomes important to what specific kind of content/file container we are dealing with here.

  • How to make new project in existing folder with applescript in Aperture?

    I want to create a new project in an existing folder. I've scoured the web for answers to this but I cant find any. The closest I've come is this:
    tell application "Aperture"
    set imgSel to (get selection)
    if imgSel is {} then
    error "Please select an image."
    else
    set pName to name of parent of item 1 of imgSel
    set pID to id of parent of item 1 of imgSel
    set cID to id of parent of parent of item 1 of imgSel
    set cName to name of parent of parent of item 1 of imgSel
    set cLoc to folder cName
    tell library "Aperture Library"
    make new project at cLoc with properties {name:pName}
    repeat with i from 1 to count of imgSel
    move item i of imgSel to project (pName)
    end repeat
    end tell
    end if
    cLoc
    end tell
    Which returns:
    error "Aperture got an error: AppleEvent handler failed." number -10000
    Can anyone enlighten me as to what I'm doing wrong here or show me another way to achieve my goal, thanks?

    when you say 'new project in an existing folder'..... I assume you mean to create a new Project inside of an existing "Blue" folder...?
    Easy.... Select (click) the Blue folder you wish a new Project to appear inside > At the top left corner where it says "new" click the drop down arrow and select the project icon and click it.
    Easier still > select the Blue folder you wish another Project to appear inside > use 'Command & N' on the keypad and away you go...
    If you dont mean the above...? and you want a blue folder inside a blue folder..?
    To create a new blue folder use either the 'New' icon again at the top of the library inspector and click the blue folder icon or (Shift & Command & N ) on the keypad. Then select the new blue folder and repeat the process again...... A folder inside a folder..
    Couldn't be simpler....
    Aperture already provides these simple commands.... I cant imagine why you want to write an 'Applescript Action' for it.... Unless just for the heck of it...??
    Regards..... Gerry...

  • How to make new column in table changing depending on other columns

    hi
    i have table and i want to add new column that calculate the deference between two other columns.
    i create the column and i could loop in the content of the table but i could not update the entries in the new columns.
    regards
    Said

    Hi!
    did u try creating a node for the same? create a value node for the table with 3 value attrbutes, one for each column. then in the init method of that view, just create 3 arrays, setting the value in the first two array. then make use of this code for setting the difference in the thrid column
    IPrivateUIView.I<valuenode> tab_node = wdContext.node<valuenode>();
    for(int i= 0; i<6;i++)
         IPrivate<view>.I<valueelement> num_ele = tab_node.create<valueelement>();
         num_ele.set<valueattribute1>(num1<i>);
         num_ele.set<valueattribute2>(num2<i>);
         num_ele.set<diffvalueattribute>(num1<i>-num2<i>);
         wdContext.node<valuenode>().addElement(num_ele);
    this will surely work .
    Do let me know the results.

Maybe you are looking for

  • Mac 10.5.6 Upgrade - Disc Image issue, as downloaded on a PC for my Mac

    Hi, I would like to upgrade my Mac OS (currently on version 10.4). I use dialup internet and so I cannot download the update onto my Mac, through dialup. However, I have gone to my brothers house and downloaded the update onto his PC laptop, which I

  • Photoshop Type Library Error

    Hi, Anyone can tell me the cause of this error "Additional information: QueryInterface for interface PhotoshopTypeLibrary.IPhotoshopApplication failed.". I'm using photoshop cs3 type library in VB.Net. Below is my codes Imports PhotoshopTypeLibrary S

  • Report required for payments made

    Hi I want to know TCode for the report which shows: 1. List of payments made within & over due dates 2. List of payments to be made on due dates

  • Standard application buttons in alv report

    i am using function module 'reuse_alv_list_display'.   in my report i have all the standard buttons such as last, next previous,first etc.    but the buttons such as CHOOSE and SAVE is missing.   what should i do in the code to invoke these two stand

  • Array store exception -- JNI

    Hi, I am trying to return a string array in the native function to java and i get the follwing error when i run the java class file Exception in thread "main" java.lang.ArrayStoreException at ArrayHandler.returnArray(Native Method) at ArrayHandler.ma