ygini / Hello-IT

Self support apps provided by IT services to end users.
BSD 3-Clause "New" or "Revised" License
286 stars 32 forks source link

public.command not working #63

Open jaltonen opened 2 years ago

jaltonen commented 2 years ago

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 commented 2 years ago

Hello

Can you paste the example you are talking about here?

jaltonen commented 2 years ago

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 commented 2 years ago

Can you show me your final plist?

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

jaltonen commented 2 years ago

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.

`<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

content functionIdentifier public.script.item settings path /Library/Scripts/ShowSerial.sh repeat 0 functionIdentifier public.title settings title VCUarts Technology Support functionIdentifier public.title settings title (804) 828-7045 functionIdentifier public.separator functionIdentifier public.open.resource settings URL https://itsupport.vcu.edu/ title Create New VCUarts Service Request functionIdentifier public.open.application settings title Managed Software Center app Managed Software Center functionIdentifier public.open.application settings title Apple Updates app openAppleUpdatesPane functionIdentifier public.open.application settings title Adobe Creative Cloud app Creative Cloud functionIdentifier public.open.application settings title Show ip address app showipAddress functionIdentifier public.open.application settings title Temporary Admin app TempAdminActivator functionIdentifier public.open.application settings title Cisco VPN app Cisco AnyConnect Secure Mobility Client functionIdentifier public.open.application settings title Connect to file server app SOAConnect functionIdentifier public.separator functionIdentifier public.separator functionIdentifier public.quit title vcuarts help desk

`

jaltonen commented 2 years ago

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 commented 2 years ago

"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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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.