Etiquette Question

Want to talk about something that isn't covered by another category?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
trailboss
Posts: 121
Joined: Sat Dec 13, 2008 4:55 pm

Etiquette Question

Post by trailboss » Fri Mar 22, 2013 10:54 pm

I posted a question in the Live Code area and got great info that I can use. I had a different but related question and thought it might be best in the Rich Media area. It has been days and it has received 67 views but no replies. Is it bad manners if I post the same question in some other area? FYI: I just wanted to know how to paste a graphic from runrev into a PowerPoint document.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Etiquette Question

Post by Simon » Fri Mar 22, 2013 11:19 pm

Hi,
You can "bump" (add more information) to your original post, best not start a new post.
I (and others) watch for new or unanswered posts across all the LC forums, it's something like posts (or bumped posts) made in the last 24 hours but it changes I think.

To address your original post it wasn't particularly about what you can do in LC but more about PowerPoint and as this is an LC forum...
Also I would never want to be so fat headed as to say something cannot be done. I think the research is up to you.

Oh, I was just lucky in finding that notepad ppt site, thought it was an interesting challenge, maybe mislead you. Have you tried PowerPoint forums?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Etiquette Question

Post by FourthWorld » Fri Mar 22, 2013 11:24 pm

trailboss wrote:I posted a question in the Live Code area and got great info that I can use. I had a different but related question and thought it might be best in the Rich Media area. It has been days and it has received 67 views but no replies. Is it bad manners if I post the same question in some other area?
It's very helpful for the community if a given question is posted to a single place. If posted in multiple places, folks may not know where to post their reply, or newcomers may find only one of the two threads and have an incomplete understanding of the issue.

When an item sits outstanding for a while, it can be helpful to add a post to the thread to bump it into view for those who use "New Posts" when they log in here. There are no established rules for how frequently you can bump a thread, but as a practical matter it does little good to bump it more than once per 24 hours.
FYI: I just wanted to know how to paste a graphic from runrev into a PowerPoint document.
It may simply be that no one here knows. Copying within LiveCode is easy enough, but automated pasting into another program will require that program to have some means of supporting such automation. Most MS Office tools use VBScript, so you may be able to get some tips on using VBScript for that in a forum for that product.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Etiquette Question

Post by sturgis » Sat Mar 23, 2013 3:46 am

I know this is not the right place to answer the question, but i'm too tired to go look for the other question!

If you want to copy an object (like a graphic) to the clipboard from code you can import snapshot from the grc, put the data into the clipboard, then do what you want with it. Somehting like this.

Code: Select all

lock screen
import snapshot from grc 1
set the clipboarddata["image"] to the last image
delete the last image
unlock screen
Then as noted, if you want to automate the paste into another program you'd have to use vbscript or applescript on mac, or just manually go over and paste it in.

If course if its already an image, just set the clipboarddata["image"] to it and you're good to go.

trailboss
Posts: 121
Joined: Sat Dec 13, 2008 4:55 pm

Re: Etiquette Question

Post by trailboss » Sat Mar 23, 2013 3:51 pm

Well, it shows what I know. I thought that as I learned more I could get RunRev to do the things I imagined it would be able to do. The script I have does, in effect at least, create a PP doc and "paste" text into it and the result is a pp presentation with many slides with headings, text, and subtext. It seemed natural that one could do the same thing with a graphic. Well, this may be enough.

Do I "bump" my question just by editing it and reposting it?

Thanks

Tom

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Etiquette Question

Post by sturgis » Sat Mar 23, 2013 4:22 pm

Hmm Truthfully, if you are just using paste from a script to pop stuff into PP I don't see why it wouldn't work from LC, just don't know enough about pp myself to understand how much control you might need as far as image position and that sort of thing. Should be possible (if you can paste in text already) to paste in the image once you have it shoved into the clipboard (easy to do) and then even something as simple as using vbscript to send the pastekeys to PP should work.

I'm sure more powerful things can be done, since office apps have a vbscript api built in. Just curious too.. I know that excel now saves things in a zipped xml format. I also have a way around here somewhere that lets you create an excel compatible file by building an xml file then opening it in excel. Are powerpoint files now xml based also? If so, then it should be possible to build a file that will work in powerpoint entirely within LC. Yet another thing I don't have time to learn. (though its interesting enough to be on my list) So much to learn, so little time.

trailboss
Posts: 121
Joined: Sat Dec 13, 2008 4:55 pm

Re: Etiquette Question

Post by trailboss » Sat Mar 23, 2013 4:41 pm

Well, actually I put quotes around the word "paste" because I didn't do anything with the clipboard. I don't know how to paste from the clipboard into another document. I wrote this and if you use tabs as subheadings you get a powerpoint presentation with multiple slides with headings subtext and subtext...

on mouseUp
open file specialFolderPath("desktop") & "/Data in a PowerPoint Document.ppt" for write
put cd fld "MyData" into localvariable
put localvariable into myText
write myText to file specialFolderPath("desktop") & "/Data in a PowerPoint Document.ppt"
close file specialFolderPath("desktop") & "/Data in a PowerPoint Document.ppt"
launch document specialFolderPath("desktop") & "/Data in a PowerPoint Document.ppt"
end mouseUp

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Etiquette Question

Post by sturgis » Sat Mar 23, 2013 6:01 pm

EDIT: While i'm at it, just curious. Would it work to use LC as your presentation engine? Might be handy to be able to set up a presentation and make a build that can run on 3 desktop platforms plus ios and android.

Ah k, sorry. My mistake I thought you were wishing to have a live copy and paste session between ppt and lc.

If you're looking to generate a powerpoint with links to images and the like, this may get you started. The code is vbscript. (I'd suggest using lc to generate the vbscript code you need, pop it into a file and then execute the vbs file so that you don't have to fight with the internal lc scripting host connection)

I don't have easy access to wondows at the moment much less a machine with powerpoint, but this looks promising to me. If you have a standard setup for a slide that you need to generate, you can replace things like the absolute path to an image file with a [[placeholderVariable]] then as you loop through, merge in the path as you loop through making each slide. Any changing data that needs to be inserted into the final script can use a [[]] placeholder with merge to make it easier to build the final creation script.

Code: Select all

Dim pptDoc
Dim pptPresentation
Dim pptSlide

Set pptDoc = WScript.CreateObject( "PowerPoint.Application" )
pptDoc.Visible = True
Set pptPresentation = pptDoc.Presentations.Add( True )

' Add a new slide with a blank layout to the end of the Slides collection
' 12 = ppLayoutBlank
Set pptSlide = pptPresentation.Slides.Add( pptPresentation.Slides.Count + 1, 12 )

' Add a picture into the slide, saving the picture into the PowerPoint document
' 10, 10 are the Left and Top coordinates respectively
pptSlide.Shapes.AddPicture "c:\FullPath\1.JPG", False, True, 10, 10

' Add another slide with a picture
Set pptSlide = pptPresentation.Slides.Add( pptPresentation.Slides.Count + 1, 12 )
pptSlide.Shapes.AddPicture "c:\FullPath\2.jpg", False, True, 10, 10
If I understand correctly, this will talk to powerpoint and generate the presentation. (inside powerpoint) at which point you can make any adjustments and save it. If you want to save it as part of the script you can use pptPresentation.SaveAs

Found this information here: http://stackoverflow.com/questions/5037 ... frames-out

And there is another link on the page to the heavy duty info on this stuff here: http://msdn.microsoft.com/en-us/library/ff746873.aspx

EDITEDIT:

Heres another code snippet that might be more useful. The link is here: http://gallery.technet.microsoft.com/sc ... f428eb6502
And heres the sample code. Again, it would be easy (hopefully) to use placeholders to create the vbs file in a loop. This example uses a powerpoint template file as the beginning point. (which could be very handy)

Code: Select all

Set objPPT = CreateObject("PowerPoint.Application") 
objPPT.Visible = True 
Set objPresentation = objPPT.Presentations.Add 
objPresentation.ApplyTemplate("C:\Program Files\Microsoft Office\Templates\Presentation Designs\Globe.pot") 
 
strComputer = "." 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") 
Set colProcesses = objWMIService.ExecQuery("Select * From Win32_Process") 
 
For Each objProcess in colProcesses 
    Set objSlide = objPresentation.Slides.Add(1,2) 
    Set objShapes = objSlide.Shapes 
 
    Set objTitle = objShapes.Item("Rectangle 2") 
    objTitle.TextFrame.TextRange.Text = objProcess.Name 
 
    strText = "Working set size: " & objProcess.WorkingSetSize & vbCrLf 
    strText = strText & "Priority: " & objProcess.Priority & vbCrLf 
    strText = strText & "Thread count: " & objProcess.ThreadCount & vbCrLf 
 
    Set objTitle = objShapes.Item("Rectangle 3") 
    objTitle.TextFrame.TextRange.Text = strText 
Next 
 
objPresentation.SaveAs("C:\Scripts\Process.ppt") 
objPresentation.Close 
objPPT.Quit 
Last edited by sturgis on Sat Mar 23, 2013 6:11 pm, edited 1 time in total.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Etiquette Question

Post by FourthWorld » Sat Mar 23, 2013 6:08 pm

trailboss wrote:Well, actually I put quotes around the word "paste" because I didn't do anything with the clipboard. I don't know how to paste from the clipboard into another document. I wrote this and if you use tabs as subheadings you get a powerpoint presentation with multiple slides with headings subtext and subtext...

on mouseUp
open file specialFolderPath("desktop") & "/Data in a PowerPoint Document.ppt" for write
put cd fld "MyData" into localvariable
put localvariable into myText
write myText to file specialFolderPath("desktop") & "/Data in a PowerPoint Document.ppt"
close file specialFolderPath("desktop") & "/Data in a PowerPoint Document.ppt"
launch document specialFolderPath("desktop") & "/Data in a PowerPoint Document.ppt"
end mouseUp
The only thing happening there with LC is writing a file. The magic happens in PPT, where the file is read and parsed out to create multiple slides.

It would seem the next bit of research to do with PPT's capabilities would be to post a question to those forums, asking if there's a way such import formats can include image paths.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

trailboss
Posts: 121
Joined: Sat Dec 13, 2008 4:55 pm

Re: Etiquette Question

Post by trailboss » Tue Mar 26, 2013 9:57 pm

I'll have to look into that. I shouldn't be such a difficult thing. I was hoping it would be just like what I had done. I got PP to read the text. I got that text into powerpoint. I hoped I could do it with an image as well.

By the way, I received a message saying that there had been a reply to my original question, but when I went there there was no reply.

Thanks,
Tom

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Etiquette Question

Post by jacque » Wed Mar 27, 2013 6:23 pm

By the way, I received a message saying that there had been a reply to my original question, but when I went there there was no reply.
That happens to me all the time. It's spammers. You get a notification, then one of the moderators deletes the spam, and by the time you go look the message has been poofed away.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Off-Topic”