Jump to content

I am supporting a doctor who has painstakingly created PowerPoints for 3 decades and is having issues with the PowerPoints that have linked videos in them. All of his files with embedded video are fine.

 

This may be a side effect of using OneDrive. However, the solution I am looking for is to:

  1. Filter his files to down to ONLY those which are using linked media

  2. Replace the linked media with embedded media

Since there are hundreds, if not thousands of files, doing this individually is not a reasonable option. I am hoping someone knows of a tool or a script that automate this process.

 

I would also appreciate help to find what the broken links are trying to point to. That way, I can embed the videos on an as needed basic until a better solution is found.

Link to post
Share on other sites

My first approach here would be file size. A file that contains only a link should be much smaller than a file with embedded media.

 

Otherwise, you could probably parse the file and see if you can use e.g. grep to see if it contains certain keywords.

Remember to either quote or @mention others, so they are notified of your reply

Link to post
Share on other sites

2 minutes ago, Eigenvektor said:

My first approach here would be file size. A file that contains only a link should be much smaller than a file with embedded media.

 

Otherwise, you could probably parse the file and see if you can use e.g. grep to see if it contains certain keywords.

Thank you for that suggestion. Although, I don't know how I would exactly filter by file size because the doctor does have powerpoint files embedded images. Those files would be smaller than the powerpoints with embedded videos, but would not necessarily have linked videos. I am really hoping there si a script or a tool that can simply check if a powerpoint file has a linked video in it, if it does, replace the linked video by embedding it. If I am asking the impossible, I would at least like to be able to generate a list of only the powerpoint files that have linked videos.

Link to post
Share on other sites

i know my answer might sound like a rude answer, but it is 100% not:

 

did you try asking copilot? 

 

even though it's by no means the best of the AI out there, i've noticed that since it's "inside" microsoft it can be really helpful specially on tasks that gravitate Microsoft related products, for example, i wanted to create an automation for microsoft teams using python and microsoft graphs api, i have 0 knowledge about the process and i can mostly read python code and understand what it's doing, surprisingly after a couple hours i had the base of the script fully working and it could do basic tasks without many tries and fails.

 

copilot is actually a good weapon against microsoft problems, being said problems actual issues (New Outlook 365, i'm looking at you buddy.....) or simple task around the office suite. give it a try! it might come in help.

 

in my company we have the base version of copilot for free coming with our office business suite licenses and it's surprisingly good! i use it for mostly outlook problems since the new outlook 365 is a big pile of steaming poop and bugs and i get many requests from my collegues, sometimes it spits out good answers and if it not a straightforward good answer a couple tries and better prompt actually can get you to the answer, after all it's tenticles are mostly inside microsoft forums and FAQs

i use Arch (Btw™) but i will not bother you with the linux is better then windows war ❤️

Link to post
Share on other sites

just for a test, i've entered your post into copilot and this is the answer he gave me. probably not what you're looking for but it's just an example, if you explain what you need in a very detailed way it might give you a correct answer.
 

 

It sounds like a challenging situation, but there are tools and scripts that can help automate this process. Here are some steps and resources that might be useful:

1. Filter Files with Linked Media
To identify PowerPoint files with linked media, you can use a VBA macro. Here's a simple script that lists all linked files in a presentation:

Sub ListLinkedFiles()
    Dim osld As Slide
    Dim oshp As Shape
    Dim strMessage As String
    On Error Resume Next
    For Each osld In ActivePresentation.Slides
        For Each oshp In osld.Shapes
            Err.Clear
            Debug.Print oshp.LinkFormat.SourceFullName
            If Err = 0 Then
                strMessage = strMessage & "Slide: " & osld.SlideIndex & _
                " Shape: '" & oshp.Name & "' Is Linked" & vbCrLf
            End If
        Next
    Next
    If strMessage = "" Then
        strMessage = "No linked files found"
    End If
    MsgBox strMessage
End Sub
This script will list all linked files and the slides they appear on [1].

2. Replace Linked Media with Embedded Media
To automate the process of embedding linked media, you can use another VBA macro. Here's a script that changes linked videos to embedded ones:

Sub EmbedLinkedVideos()
    Dim osld As Slide
    Dim oshp As Shape
    On Error Resume Next
    For Each osld In ActivePresentation.Slides
        For Each oshp In osld.Shapes
            If oshp.Type = msoMedia Then
                If oshp.LinkFormat.SourceFullName <> "" Then
                    oshp.LinkFormat.BreakLink
                End If
            End If
        Next
    Next
End Sub
This script will embed linked videos into the presentation [2].

3. Find Broken Links
To find broken links, you can use the "Edit Links to Files" feature in PowerPoint:

Go to File > Info.
Under Related Documents, click Edit Links to Files.
Here, you can update or remove broken links [3].
Tools and Resources
FixLinks: A tool that can help manage and fix links in PowerPoint presentations [4].
Indezine: Provides VBA scripts and detailed instructions for managing linked media [2].
These steps should help streamline the process and make it more manageable. If you need further assistance, feel free to ask! 


References
[1] How to find all linked files in a PowerPoint presentation.
[2] Convert linked media to embedded media - Microsoft Community
[3] Update or remove a broken link to an external file
[4] list Powerpoint linked files - Microsoft Community
 

i use Arch (Btw™) but i will not bother you with the linux is better then windows war ❤️

Link to post
Share on other sites

6 hours ago, y0ur5h4d0w said:

if you explain what you need in a very detailed way it might give you a correct answer.

In this case it really doesn't. The first function at least will return you a list of linked files, but it's weird that it outputs the file path to the console and still writes a message intended to display in a message box, where it's arguably useless and anyone running a VBA script without knowing what they're doing is bound to not notice the console filling up and potentially overflowing, if it's even enabled by default in the IDE.

 

It also suggests using On Error Resume Next, which is terrible practice in most cases, since it turns off errors and just continues with the script. And it's doubly weird that it still does some very rudimentary error checking, but not in a way how you'd usually write error handling in VBA.

 

Where it utterly breaks down is in the second function, where the description claims that it's embedding the files it finds, but all it does is break the link to whatever file was previously linked.

 

Lastly, this only goes through a single file, meaning you'd have to open every file manually, put in that macro and run it. What you'd want is some type of recursive function that loops through all the folders, opens all the PowerPoint files and executes the requested functions on each of them.

 

That's the issue with vibe coding, you can be as precise as you want, if you don't understand what it spits out, you'll never know where the issue lies.

And now a word from our sponsor: 💩

-.-. --- --- .-.. --..-- / -.-- --- ..- / -.- -. --- .-- / -- --- .-. ... . / -.-. --- -.. .

ᑐᑌᑐᑢ

Spoiler

    ▄██████                                                      ▄██▀

  ▄█▀   ███                                                      ██

▄██     ███                                                      ██

███   ▄████  ▄█▀  ▀██▄    ▄████▄     ▄████▄     ▄████▄     ▄████▄██   ▄████▄

███████████ ███     ███ ▄██▀ ▀███▄ ▄██▀ ▀███▄ ▄██▀ ▀███▄ ▄██▀ ▀████ ▄██▀ ▀███▄

████▀   ███ ▀██▄   ▄██▀ ███    ███ ███        ███    ███ ███    ███ ███    ███

 ██▄    ███ ▄ ▀██▄██▀    ███▄ ▄██   ███▄ ▄██   ███▄ ▄███  ███▄ ▄███▄ ███▄ ▄██

  ▀█▄    ▀█ ██▄ ▀█▀     ▄ ▀████▀     ▀████▀     ▀████▀▀██▄ ▀████▀▀██▄ ▀████▀

       ▄█ ▄▄      ▄█▄  █▀            █▄                   ▄██  ▄▀

       ▀  ██      ███                ██                    ▄█

          ██      ███   ▄   ▄████▄   ██▄████▄     ▄████▄   ██   ▄

          ██      ███ ▄██ ▄██▀ ▀███▄ ███▀ ▀███▄ ▄██▀ ▀███▄ ██ ▄██

          ██     ███▀  ▄█ ███    ███ ███    ███ ███    ███ ██  ▄█

        █▄██  ▄▄██▀    ██  ███▄ ▄███▄ ███▄ ▄██   ███▄ ▄██  ██  ██

        ▀███████▀    ▄████▄ ▀████▀▀██▄ ▀████▀     ▀████▀ ▄█████████▄

 

Link to post
Share on other sites

the example i provided is just 1 single try, i didn't cook any well written prompt that could lead to something solid, crafting a working prompt takes a lot of thinking time, code flow breaking down and tries. Once you understand how to make the prompt though it's pretty interesting how fast the results can be at least usable for a PoC

 

as i stated before pasting the answer

8 hours ago, y0ur5h4d0w said:

just for a test, i've entered your post into copilot

 

 

as per the vibe coding part:

1 hour ago, Avocado Diaboli said:

In this case it really doesn't. The first function at least will return you a list of linked files, but it's weird that it outputs the file path to the console and still writes a message intended to display in a message box, where it's arguably useless and anyone running a VBA script without knowing what they're doing is bound to not notice the console filling up and potentially overflowing, if it's even enabled by default in the IDE.

 

It also suggests using On Error Resume Next, which is terrible practice in most cases, since it turns off errors and just continues with the script. And it's doubly weird that it still does some very rudimentary error checking, but not in a way how you'd usually write error handling in VBA.

 

Where it utterly breaks down is in the second function, where the description claims that it's embedding the files it finds, but all it does is break the link to whatever file was previously linked.

 

Lastly, this only goes through a single file, meaning you'd have to open every file manually, put in that macro and run it. What you'd want is some type of recursive function that loops through all the folders, opens all the PowerPoint files and executes the requested functions on each of them.

 

That's the issue with vibe coding, you can be as precise as you want, if you don't understand what it spits out, you'll never know where the issue lies.

i agree that vibe coding CAN be dangerous and CAN even be bad written and YES i 100% agree that a basic knowledge of at least error handling and code reading is needed, everything though relates to how well you explain to the AI what you want and have the patience of the good old trial and error game, for me, with both chatGPT 4o and copilot i was able to write 3 fully functioning and actually nice written 600+ lines of code scripts that works flawlessly without any error. It's not easy and it's time consuming, but you will eventually end up with a working code, if you don't care about the "perfection" of the code but just need it run and work it takes even less time.

the script that i'm more proud of took me 5 months working about 3/4 hours a day to build, test, try to understand the errors, fix the errors and so on... in the end it works so damn nice. I have a folder with about 200 fail tries that i kept in order to help chatGPT to craft the final code because many parts of some fail codes were working perfectly and ended into the final version. This script is very particular and i wanted it to be really polished that's why it took me a buttload of time.

 

i would give Vibe coding a shot if time consents it in a case like this where if i understood correctly the OP need:

1. given a PATH all the files have to be scanned, subfolders crawled as well
2. from here, for every file that matches a given extension, it's full path including the file name needs to be written into a json file

3. all the files inside the json then needs to be opened and check for a specific case and another json with a different name to be made with only the files matches a specific case.

4. execute a specific action on the path of the files inside the json

 

since it seems like a not so weird API interaction it probably will be (sort of, depending on how well you can produce the prompts and explain yourself to the AI) not that time consuming. Almost certenly there's a way to do this in python because i've had a project that was going to read an excel cell looking for columns with a give name and process data based on the column content.

 

 

these are personal takes based on my experience, i'm NOT a programmer and I'M NOT saying that vibe coding is the best solution, it's a good solution to solve problems if you have some time to spend and want a good enough result (or you want to spend A LOT OF TIME and get a great result), for my case it wasn't easy because AI have issues (hallucinations) but with patience the outcome works and it's amazing how it works. vibe coding will never ever replace programmers for sure, but for small projects is amazing and shaves costs.

PS: sorry everyone for the long ass post i just wanted to provide my personal experience with vibe coding and the way i would approach the situation

i use Arch (Btw™) but i will not bother you with the linux is better then windows war ❤️

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×