Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Macro to toggle between fullscreen
#1
Hi all, brand new user here, I've been toying about with this fantastic package and i was hoping one of you fine experts would be able to help.

I would like to use a macro to toggle fullscreen on and off when ever i use the # key.
I'm using microsoft powerpoint and can get it to go fullscreen but not back to normal view again.
Also, as I have a large slideshow, I would like to come out of fullscreen to normal view, navigate manually to the next slide then use the macro to go back into fullscreen, currently my macro starts the slideshow from the beginning and thats not what Im trying to achieve (Hope Im not confusing things, I think it should be pretty simple to do but its beyond my limited talents)


Heres how far I have got :roll:
Code:
Copy      Help
act win("Microsoft PowerPoint - [test]" "PP12FrameClass")
'F5

Thanks for all replies
#2
Macro Macro1415
Trigger 3 /POWERPNT     Help - how to add the trigger to the macro
Code:
Copy      Help
ifa "PowerPoint Slide Show" ;;in slideshow (fullscreen)
,key Z ;;Esc to stop slideshow
else ;;not in slideshow
,key SF5 ;;press Shift+F5 to start show from current slide

;---------------

;How did I know the fullscreen window name?
;I press Ctrl+Shift+Win+W and select 'Get window handle'. It inserts code like this:  int w2=win("PowerPoint Slide Show - [Title.ppt]" "screenClass")
;When not in fullscreen, it inserts:  int w1=win("Microsoft PowerPoint - [Title.ppt]" "PP11FrameClass")
#3
Hi there, thanks for your kind reply, unfortunately it doesn't appear to work. Maybe a little more background info is needed?
I am using 2 foot switches (Foot switch (A) and foot switch (B) ) that can be assigned to any key on the keyboard which is great for assigning triggers.
So here is the process I would like the macro to handle. Maybe I need 2 macros?

1)i want to be able to press the foot switch (A)to go into full screen
2)then I use another foot switch (B) to advance to the next slide (I can do this just fine)
3)then I want to be able to use foot switch (A) again to come out of full screen but remain on the slide I just viewed in full screen
4)I will then use foot switch (B) to advance to a different slide
5)I want to use foot switch (A) again to go into full screen

Does this help?
Thank you again, I really appreciate your help!
#4
This is macro A. Macro B will be simple.

Macro Macro1415
Trigger 3 /POWERPNT     Help - how to add the trigger to the macro
Code:
Copy      Help
;/exe 1

ifa "PowerPoint Slide Show" ;;in slideshow (fullscreen)
,;this code is for 3)
,int i=PowerPointSlidesGetCurrent(1)
,err i=PowerPointSlidesGetCount
,key Z ;;Esc to stop slideshow
,PowerPointSlidesSetCurrent i
else ;;in editor
,;this code is for 1) and 5)
,key SF5 ;;press Shift+F5 to start show from current slide

You need these functions.
Function PowerPointSlidesGetCurrent
Code:
Copy      Help
;/
function# [flags] ;;flags: 1 in slideshow

;Returns 1-based index of current slide in PowerPoint.
;Error if failed.
;By default, works in the main PowerPoint window (editor). If flag 1, works in the slideshow window (player).


typelib PowerPoint {91493440-5A91-11CF-8700-00AA0060263B} 2.8

PowerPoint.Application ap._getactive; err end "failed to connect to PowerPoint. Try to run this macro in separate process as User."

PowerPoint.Slide d
if(flags&1) d=ap.SlideShowWindows.Item(1).View.Slide
else d=ap.ActiveWindow.View.Slide

ret d.SlideIndex
err+ end ES_FAILED

Function PowerPointSlidesSetCurrent
Code:
Copy      Help
;/
function index [flags] ;;flags: 1 in slideshow

;Selects slide in PowerPoint.
;Error if failed.
;By default, works in the main PowerPoint window (editor). If flag 1, works in the slideshow window (player).

;index - 1- based slide index.


typelib PowerPoint {91493440-5A91-11CF-8700-00AA0060263B} 2.8

PowerPoint.Application ap._getactive; err end "failed to connect to PowerPoint. Try to run this macro in separate process as User."


if(flags&1) ap.SlideShowWindows.Item(1).View.GotoSlide(index -1)
else ap.ActiveWindow.View.GotoSlide(index)
;
err+ end ES_FAILED

Function PowerPointSlidesGetCount
Code:
Copy      Help
;/
function#

;Returns number of slides in PowerPoint.
;Error if failed.


typelib PowerPoint {91493440-5A91-11CF-8700-00AA0060263B} 2.8

PowerPoint.Application ap._getactive; err end "failed to connect to PowerPoint. Try to run this macro in separate process as User."

ret ap.ActivePresentation.Slides.Count

err+ end ES_FAILED
#5
thank you, that looks a bit complicated for a simple mind like mine. So do I just create a new macro and copy all of that code in?
Apologies, I am a beginner.
Thanks again
#6
Paste the first code in your macro A. Edit if need.
Create 3 new functions and paste other codes there. Don't need to edit. Also don't need to understand.


Forum Jump:


Users browsing this thread: 1 Guest(s)