Skip to content

Virtually Caffeinated

A double-shot of knowledge

Menu
  • About Me
  • Bookmarks
  • Innovative Store

About Me

Profile
Jeremy Wheeler

I am a Solutions Architect with 30+ years in IT, specializing in cloud architecture, virtualization, and multi-cloud platforms like AWS, Azure, and Google Cloud. I’ve led enterprise projects like VMware’s Horizon Suite Sizing Estimator and have extensive experience with VMware Horizon, Citrix, Hyper-V, and programming languages like PowerShell, Python, and SQL. I run Smart AI Coach (https://smartaicoach.com/), helping individuals leverage AI for resumes, cover letters, and productivity. As a published author, VMware vExpert (2015-2020), and MIT-certified in AI, I am passionate about innovation and solving challenges.

  • Home
  • 2019
  • October
  • 11
  • Move OmniGraffle Package to Flat Format
News

Move OmniGraffle Package to Flat Format

Jeremy Wheeler
October 11, 2019December 4, 2024 3 mins

Hey all, I wanted to share a useful script if you have a bunch of OmniGraffle files that are saved as Automatic or Package format to Flat. This makes them more Windows friendly especially if you store the files on OneDrive. Execute this script using Mac’s Script Editor. Select a folder that contains the OmniGraffle Documents or Stencils. This script will go through each document, open it, convert it, save it, close it. This script will also go into any subdirectories from your selected root folder. Special thanks to Christian Y. from the OmniGroup team for its initial creation.

# Original script created by Christian Y. (Support Human) in the OmniGroup
# for the VMware Design Team - 2019
# Version 1.0

property errorList : "" # Used to build a list of files with errors

on run
    set errorList to "" # Reset the error list for each run
    
    tell application "Finder"
        set sourceFolder to choose folder with prompt "Please select a folder containing OmniGraffle files:"
        set foundItems to (items of sourceFolder) as alias list
        my getFilesToProcess(foundItems)
    end tell

    if errorList is not "" then
        display alert "An error occurred trying to process the following files:" message errorList
        return errorList
    end if
end run

on getFilesToProcess(foundItems)
    tell application "Finder"
        set filesToProcess to {}

        repeat with anItem in foundItems
            set fileExt to name extension of anItem
            
            if kind of anItem is "folder" then
                set folderContents to (items of anItem) as alias list
                my getFilesToProcess(folderContents)
            else if fileExt is "graffle" or fileExt is "gstencil" or fileExt is "gtemplate" then
                copy anItem to end of filesToProcess
            end if
        end repeat

        my processFiles(filesToProcess)
    end tell
end getFilesToProcess

on processFiles(graffleFiles)
    repeat with aFile in graffleFiles
        tell application "OmniGraffle"
            try
                open aFile
                delay 0.6

                tell application "System Events" to tell process "OmniGraffle"
                    set frontmost to true
                    delay 0.5

                    # Handle potential alerts or prompts
                    try
                        click button "OK" of sheet 1 of window 1
                        delay 0.5
                    end try

                    try
                        click button "Edit in Place" of sheet 1 of window 1
                        delay 0.5
                    end try

                    # Access "Document" settings in "Inspectors" menu
                    click menu item "Document" of menu "Inspectors" of menu bar item "Inspectors" of menu bar 1

                    try
                        # First attempt: Sidebar hidden
                        tell pop up button 1 of scroll area 2 of splitter group 1 of window 1
                            click
                            delay 0.5
                            click menu item "Save as flat file" of menu 1
                        end tell
                    on error
                        # Alternate attempt: Sidebar visible
                        tell pop up button 1 of scroll area 3 of splitter group 1 of window 1
                            click
                            delay 0.5
                            click menu item "Save as flat file" of menu 1
                        end tell
                    end try
                end tell

                tell front document
                    save
                    delay 0.5
                    close
                end tell

            on error
                tell application "Finder"
                    set filename to name of aFile
                    set parentFolder to name of container of aFile
                    set errorList to errorList & "- " & parentFolder & "/" & filename & return
                end tell
            end try
        end tell
    end repeat
end processFiles
Share :
whosay

Written by  Jeremy Wheeler: Jeremy

I am a seasoned Solutions Architect with over 20 years of expertise in IT, specializing in cloud architecture, virtualization, and end-user computing solutions. My career highlights include working with top-tier technologies across multi-cloud platforms such as AWS, Azure, and Google Cloud. I have a proven track record of leading complex enterprise projects, including the development of tools like VMware’s Horizon Suite Sizing Estimator, which optimized hardware prediction accuracy for customers worldwide. With hands-on experience in virtualization technologies like VMware Horizon, Citrix, and Hyper-V, I excel in designing, deploying, and optimizing full-lifecycle solutions. My technical depth is complemented by 18 years of computer programming experience in PowerShell, Python, C++, .NET, SQL, and more. I am a published author and have contributed to industry literature, including works on desktop virtualization and user environment management. Recognized as a VMware vExpert for six consecutive years (2015-2020), I’ve also received multiple awards for excellence, such as VMware Spotlight and Our Best accolades. Currently, I leverage my knowledge to deliver innovative solutions, combining strategic insights and cutting-edge technologies like AI, as evidenced by my recent certification from MIT. Above all, I thrive on solving challenges and empowering teams to exceed customer expectations.

Post navigation

Previous: VMware User Environment Manager and Sysinternals BGinfo
Next: Cool Resources for your Kids at home during this time..

Related Post

Navigating New Horizons: My Career Transition and What’s Next

VMware vExpert 2015

Announcing My New Book – AI for Ministry

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Categories

Recent Posts

  • Preventing Hallucination in AI: A Guide Based on Industry Standards
  • Clash of the AI Titans: Gemini 2.5 vs. ChatGPT-4o – Which Reigns Supreme?
  • VMware Explore 2025: Shaping the Future of Multi-Cloud and Edge Technologies
  • AI Trends Shaping the Future in 2025
  • Omnissa vApp and AI: Transforming Application Delivery in 2025

Archives

RSS Press Releases

Copyright VMBUCKET.COM © 2020