2

I'm using FluidApp Version 1.8.6 (2331) on MacOS Sierra 10.12.3. Sometimes I need to copy current URL of Web page in FluidApp. I want to do it with keyboard shortcut and I know I need to use a service for it.

So how do I create a service for this job?

1

If you're having issues using L, C and Esc and you want an AppleScript script that runs as an Automator Service, in order to copy the URL of a Fluid App, created with Fluid, then here is an example scenario you could implement.

Under macOS 10.12.3 using Fluid (Version 1.8.6 (206)) and the URL of this question, I created a Fluid App named Ask Different Question.

Ask Different Question Fluid App

I them made an Automator Service workflow using a Run AppleScript action and the AppleScript code below.

set appName to "Ask Different Question"

tell application appName
    activate
    tell application "System Events"
        set toolbarState to (name of every menu item of menu 1 of menu bar item 5 of menu bar 1 of application process appName)
        if toolbarState contains "Show Toolbar" then
            keystroke "t" using {option down, command down}
            set the clipboard to (get value of text field 1 of group 1 of toolbar 1 of window 1 of application process appName)
            keystroke "t" using {option down, command down}
        else
            set the clipboard to (get value of text field 1 of group 1 of toolbar 1 of window 1 of application process appName)
        end if
    end tell
end tell
  • Note that all you should have to change in the code above is the first line, set appName to ... where ... is the name of your Fluid App. The rest of the code should then work as is.

In Automator, create a new Service workflow, adding a Run AppleScript action to it. Then replace the default code with the code above. Also change the value for Service receives to no input while selecting the target Fluid App for in, as shown in the image below. Then save the Automator Service workflow.

Automator Image

The next step is to assign a keyboard shortcut for the Automator Service workflow you've just created.

In System Preferences > Keyboard > Shortcuts > Services, find your service and set its shortcut.

I used U as that was easy to remember using U for URL.

Services Keyboard Shortcut Image

The last thing you'll need to do, is add the Fluid App you created that will use the Automator Service workflow you've just created to System Preferences > Security & Privacy > Privacy > Accessibility as shown in the image below for the Ask Different Question app I created in Fluid.

Security & Privacy Image

Now when you're in the Fluid App you created and press U, the URL will be copied to the Clipboard and from there you can paste it wherever you'd like.

  • Hi, again. It's working in the Automator. But it doesn't work with app itself and I met with an error alert (its says: "The action “Run AppleScript” encountered an error.". By the way I created a screencast for this issue. You can watch it from here: cl.ly/jSe8 How can solve this issue? – fatihturan Mar 7 '17 at 16:36
  • @fatihturan, I made a Fluid App for Trillo and it works as my answer is written. My first test I had a typo but then corrected it and it works in Script Editor, Automator and from the Trillo Fluid App. Test running the code in Script Editor and see that it works there too. I'll look at it again this evening, but I have things to do this afternoon. – user3439894 Mar 7 '17 at 17:14
  • Could it be a relationship if I do the same for another Fluid app? I've tried to apply other two Fluid app too... What do you think about this? – fatihturan Mar 7 '17 at 17:17
  • @fatihturan, There is definitely a conflict if you have more then one Fluid App as the primary executable inside each Fluid App application bundle is /Contents/MacOS/FluidApp. You might need to talk to the Developer about this. – user3439894 Mar 8 '17 at 1:47
  • @fatihturan, I could reproduce the error when having two Fluid App apps, one having a keyboard shortcut and the other just the service and no shortcut much less if they both had shortcuts. I'd have to uncheck/check the non-working one in Accessibility to get it to work again, which disabled the previous working one. So it seams only one can have the service much less a shortcut. This reminds me of my programming days in Windows when I'd subclass a process under another process and it looks like something like that is going on here, although it been far to many years for me to delve into that. – user3439894 Mar 8 '17 at 14:56
0

Developer of Fluid here. I don't know much about Services, but in Fluid you can copy the current URL using keyboard shortcuts, but it requires two:

⌘L - to temporarily show and select the text of the URL location text field at the top.

⌘C - to copy the selected text.

Esc - to dismiss the toolbar at the top.

  • Its quite good tip but when I press CMD+L +, CMD+C and then ESC key, the address bar remains open. So, then I have to close it. For this reason I want to copy the address with a single key. – fatihturan Mar 3 '17 at 17:50
  • Hi Todd, can you checkout above reply and comment? – fatihturan Mar 8 '17 at 10:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .