Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

public.command not working #63

Open
jaltonen opened this issue Feb 11, 2022 · 12 comments
Open

public.command not working #63

jaltonen opened this issue Feb 11, 2022 · 12 comments

Comments

@jaltonen
Copy link

I'm probably doing something wrong
but if i paste the example from the wiki into my preference plist and reload the app it never reloads. Meaning hello it disappears from the menu bar and wont come back until i remove the public.commmand section.
I am running HelloIT v1.6

@ygini
Copy link
Owner

ygini commented Feb 11, 2022

Hello

Can you paste the example you are talking about here?

@jaltonen
Copy link
Author

https://github.com/ygini/Hello-IT/wiki/public.command

functionIdentifier public.command settings title Sample Command programArguments /usr/bin/say -v Alex Hello, I'm a Mac!

@ygini
Copy link
Owner

ygini commented Feb 11, 2022

Can you show me your final plist?

Please, use code formatting in GitHub to keep things readable.

@jaltonen
Copy link
Author

Below is my working preference file. If I paste your example code, from https://github.com/ygini/Hello-IT/wiki/public.command, into it, and do a defaults read on the preferences file, and then select reload from the app menu. Hello IT will not relaunch.

`

content
    <dict>
        <key>functionIdentifier</key>
        <string>public.script.item</string>
        <key>settings</key>
        <dict>
            <key>path</key>
            <string>/Library/Scripts/ShowSerial.sh</string>
            <key>repeat</key>
            <integer>0</integer>
        </dict>
    </dict>
    

    <dict>
        <key>functionIdentifier</key>
        <string>public.title</string>
        <key>settings</key>
        <dict>
            <key>title</key>
            <string>VCUarts Technology Support</string>
        </dict>
    </dict>
    
    
        <dict>
        <key>functionIdentifier</key>
        <string>public.title</string>
        <key>settings</key>
        <dict>
            <key>title</key>
            <string>(804) 828-7045</string>
        </dict>
    </dict>

    <dict>
        <key>functionIdentifier</key>
        <string>public.separator</string>
    </dict>
    
      
    
    <dict>
        <key>functionIdentifier</key>
        <string>public.open.resource</string>
        <key>settings</key>
        <dict>
            <key>URL</key>
            <string>https://itsupport.vcu.edu/</string>
            <key>title</key>
            <string>Create New VCUarts Service Request</string>
        </dict>
    </dict>
    
    

       
        <dict>
        <key>functionIdentifier</key>
        <string>public.open.application</string>
        <key>settings</key>
        <dict>
        <key>title</key>
      	<string>Managed Software Center</string>
      	<key>app</key>
      	<string>Managed Software Center</string>
        </dict>
        </dict>
        
         <dict>
        <key>functionIdentifier</key>
        <string>public.open.application</string>
        <key>settings</key>
        <dict>
        <key>title</key>
      	<string>Apple Updates</string>
      	<key>app</key>
      	<string>openAppleUpdatesPane</string>
        </dict>
        </dict>                   

         <dict>
        <key>functionIdentifier</key>
        <string>public.open.application</string>
        <key>settings</key>
        <dict>
        <key>title</key>
      	<string>Adobe Creative Cloud</string>
      	<key>app</key>
      	<string>Creative Cloud</string>
        </dict>
        </dict> 
        

        <dict>
        <key>functionIdentifier</key>
        <string>public.open.application</string>
        <key>settings</key>
        <dict>
        <key>title</key>
      	<string>Show ip address</string>
      	<key>app</key>
      	<string>showipAddress</string>
        </dict>
        </dict>
        
     <dict>
        <key>functionIdentifier</key>
        <string>public.open.application</string>
        <key>settings</key>
        <dict>
        <key>title</key>
      	<string>Temporary Admin</string>
      	<key>app</key>
      	<string>TempAdminActivator</string>
        </dict>
    </dict>
    
    <dict>
        <key>functionIdentifier</key>
        <string>public.open.application</string>
        <key>settings</key>
        <dict>
        <key>title</key>
      	<string>Cisco VPN</string>
      	<key>app</key>
      	<string>Cisco AnyConnect Secure Mobility Client</string>
        </dict>
    </dict>
    
        <dict>
        <key>functionIdentifier</key>
        <string>public.open.application</string>
        <key>settings</key>
        <dict>
        <key>title</key>
      	<string>Connect to file server</string>
      	<key>app</key>
      	<string>SOAConnect</string>
        </dict>
    </dict>


    <dict>
        <key>functionIdentifier</key>
        <string>public.separator</string>
    </dict>
    
  
    <dict>
        <key>functionIdentifier</key>
        <string>public.separator</string>
    </dict>
    <dict>
        <key>functionIdentifier</key>
        <string>public.quit</string>
    </dict>
</array>
<key>title</key>
<string>vcuarts help desk</string>
`

@jaltonen
Copy link
Author

Well the github code formatting is either doing something weird with my plist or it is highlighting some error that I was unaware of. It is not displaying the the plist correctly in my previous comment. The plist does however function as expected.
Maybe I will test with a simplified plist that only contains the public.command section.

@kevinmcox
Copy link

"Maybe I will test with a simplified plist"

I definitely found this approach to be helpful when I built out my Hello-IT profile (which is 562 lines long at this point). I just went step by step adding a section at a time and making sure I didn't break anything before adding the next part.

@ygini
Copy link
Owner

ygini commented Feb 12, 2022

Your sample miss the plist headers. Be sure to have something that look like the preference shown here https://github.com/ygini/Hello-IT/wiki/Preferences#content

@jaltonen
Copy link
Author

jaltonen commented Feb 12, 2022

I'm attaching a picture because when I use the code formatting tags its cutting off the header.

This simple plist with only the example from the public.comand wiki page, and a title, causes Hello IT to not load.
Screen Shot 2022-02-12 at 6 10 50 AM

@ygini
Copy link
Owner

ygini commented Feb 12, 2022

What you are showing us here is not a complete plist. Did you read the preference documentation? The link I’ve shared on my previous message?

@jaltonen
Copy link
Author

The only thing I was able to get from the linked documentation was that I was not using public.submenu as the initial function. It has always been working for me even with out that. Assuming that could be the issue I made up this simple plist.
It does not load Hello IT
Screen Shot 2022-02-12 at 6 33 57 AM

If I remove the public.command dict, it does load.

Screen Shot 2022-02-12 at 6 35 26 AM

@precursorca
Copy link

precursorca commented May 13, 2022

The example had a spelling error on:
<key>programArguments</key>
The p should be a capitalized P as in:
<key>ProgramArguments</key>

I have edited the example in the Wiki.

Now my plist will load. However, HelloIT will still not do the example command successfully and I have not been able to find the issue using Console.

@jaltonen
Copy link
Author

I concur, will load with case fix. Wont do the example. I also tried doing a touch on a file in /Users/Shared. Did not work either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants