1

I need to be able to run the script through Terminal only. I've seen other scripts that work as long as you change some settings in Accessibility; this is not an option for what I'm trying to do. I've tried the script below, but receive the following error:

0:13: script error: A real number can’t go after this identifier. (-2740)

tell application "System Events"
      set dockPlistFile to property list file "~/Library/Preferences/com.apple.dock.plist"
      tell dockPlistFile
                tell property list item "persistent-apps"
                          set appTileItems to value of (every property list item whose value of property list item "tile-data"'s property list item "file-label" is not "Terminal")
                          set its value to appTileItems
                end tell
      end tell
end tell
tell application "Dock" to quit

I'm trying to get rid of the Terminal icon from the dock. How can I do this correctly?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
  • Do you want to Remove the APP from the dock? Or do you want to have a background app without icon? – Pat_Morita Apr 03 '17 at 19:40
  • Remove the APP from the dock. – pineapple_tree Apr 05 '17 at 06:35
  • Just to clarify: You want to HIDE the icon that's popping up while your script is running? Or you want to remove an APP from the dock in general and permanent like when you do a right click and say "remove from dock"? – Pat_Morita Apr 05 '17 at 09:26

1 Answers1

0

I think this ask different answer will help you run a dock modification without changes to Accessibility settings. Basically you'll chain a launch agent XML file to a shell script and call your apple script from within that.

jorfus
  • 2,804
  • 27
  • 23