Hello-IT icon indicating copy to clipboard operation
Hello-IT copied to clipboard

public.command not working

Open jaltonen opened this issue 3 years ago • 12 comments

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

jaltonen avatar Feb 11 '22 19:02 jaltonen

Hello

Can you paste the example you are talking about here?

ygini avatar Feb 11 '22 21:02 ygini

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!

jaltonen avatar Feb 11 '22 22:02 jaltonen

Can you show me your final plist?

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

ygini avatar Feb 11 '22 22:02 ygini

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 avatar Feb 11 '22 23:02 jaltonen

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.

jaltonen avatar Feb 11 '22 23:02 jaltonen

"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.

kevinmcox avatar Feb 11 '22 23:02 kevinmcox

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

ygini avatar Feb 12 '22 06:02 ygini

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

jaltonen avatar Feb 12 '22 11:02 jaltonen

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?

ygini avatar Feb 12 '22 11:02 ygini

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

jaltonen avatar Feb 12 '22 11:02 jaltonen

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.

precursorca avatar May 13 '22 14:05 precursorca

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.

jaltonen avatar May 19 '22 19:05 jaltonen