メインコンテンツにスキップ

インターネットから猫の画像をダウンロードしてレンダリングするようにコンピュータプロセッサに指示する機械が読み込むことができるインストラクションです。

209回答 すべてを表示

Use Automator to create a Toggle Hidden Files Service macro?

I followed these instructions:

[Setting up a keyboard shortcut

While Apple helpfully provided a keyboard shortcut for use in open and save dialogs, they didn’t do the same for normal Finder windows. Luckily, it’s not too tricky to set up a keyboard shortcut yourself.

To start, open up Automator (in the Applications folder) and choose a Service template. From the library choose "Run Shell Script" and drag it across to the workflow area. In the text box paste the following command:

STATUS=`defaults read com.apple.finder AppleShowAllFiles`

if [ $STATUS == YES ];

then

defaults write com.apple.finder AppleShowAllFiles NO

else

defaults write com.apple.finder AppleShowAllFiles YES

fi

killall Finder

Finally, change the "text" drop-down menu to “no input” and then save you workflow as “Toggle Hidden Files”.

Now if you go to the Finder menu and look under Services, you should find a “Toggle Hidden Files” option. To add the keyboard shortcut, go to the Keyboard section of System Preferences and click the Keyboard shortcuts tab. Select Services from the list on the left, then scroll down to the bottom of the list on the right to find “Toggle Hidden Files”. Double-click on the area to the right of it, then press the keyboard shortcut you want. I used Command-Shift-. (dot).]

When I run the "Service Workflow" in Automator it works flawlessly and I can see in a finder window in the background that the ".hiddenfiles" do toggle "appear" "disappear".

What I can seem to do is get it to save in such a way that it actually shows up under the services menu in finder or anywhere else, for now I just have to open Automator each time and reopen the "Service" script file and run it from within Automator.

Does anyone know how to fix my issue?

All credit for original instructions to: Quickly show and hide hidden files

回答がありました! 回答を表示 同じ問題があります

この質問は役に立ちましたか?

スコア 0
コメントを追加

2件の回答

ベストアンサー

I've used this method: Making Simple Menu Bar Apps for OS X. You can't create a menu item directly off of Apple's menus but you can create your own.

このアンサーは役に立ちましたか?

スコア 2
コメントを追加

This link from lifewire shows how to make it a normal right-click menu in finder. Pretty sweet.

https://www.lifewire.com/create-menu-ite...

このアンサーは役に立ちましたか?

スコア 0
コメントを追加

回答を追加する

David Ward さん、ありがとうございました!
統計データ:

過去 24時間: 0

過去 7 日: 0

過去 30 日: 1

今までの合計 1,255