• Alex

    Should be marked as "solved" :)

    posted in Q&A read more
  • Alex

    Sincs the last unified remote app update it finally works again.

    posted in Q&A read more
  • Alex

    Maybe this helps?
    https://www.unifiedremote.com/tutorials/how-to-configure-wake-on-lan-on-windows

    Because of the fact that scripts run on the server not on the unified client (mobile) you probably won't be able to do wol and something else with one button. You'll have to do wol and then something else with another click when the server is ready.

    posted in Q&A read more
  • Alex

    I had the following script running perfectly in my custom remote. But now it breaks the unified server (3.3.3.646).
    The apple-script still runs smoothly in the script-editor on my mac.
    Don't know if a unified server update, the osx update to el capitan or something else is the culprit.

    The script checks if Chrome is running.
    If it is running it looks through all chrome-tabs for https://mail.google.com.
    If the tab exists it will be focused if not a new tab will be opened with gmail.
    If Chrome is not running in the first place it will be activated and after a short delay the gmail-tab will be focused or loaded.

    Here is the code that worked for a long time:

    actions.chrome_gmail = function()
        os.script(
            "on is_running(appName)",
                "tell application \"System Events\" to (name of processes) contains appName",
            "end is_running",
            "set chromeRunning to is_running(\"Google Chrome\")",
    
            "on doSwitch()",
                --Set the URL of the website here
                "set URLtoLookAndGoto to \"https://mail.google.com\"",
                "tell application \"Google Chrome\"",
                    "set j to 0",
                    "set foundit to false",
                    "repeat with w in (windows)",
                        "set j to j + 1",
                        "set i to 0",
                        "set windowid to id of window j",
                        "if title of active tab of window id windowid is not \"Sidewise\" then",
                            "repeat with t in (tabs of w)",
                                "set i to i + 1",
                                "if URL of t starts with URLtoLookAndGoto then",
                                    "tell application \"System Events\" to tell process \"Google Chrome\"",
                                        "set frontmost to true",
                                        "(windows where id is windowid)",
                                    "end tell",
                                    "set foundit to true",
                                    "set index of window id windowid to 1",
                                    "set (active tab index of window id windowid) to i",
                                    "return",
                                "end if",
                            "end repeat",
                        "end if",
                        "if foundit then",
                            "exit repeat",
                        "end if",
                    "end repeat",
                    "tell application \"Google Chrome\"",
                        "activate",
                        "open location URLtoLookAndGoto",
                    "end tell",
                "end tell",
            "end doSwitch",
    
            "if chromeRunning then",
                "doSwitch()",
            "else",
                "activate application \"Google Chrome\"",
                "delay 4",
                "doSwitch()",
            "end if"
        );
    end
    
    

    The same code as above without the repeat-clause doesn't break the server:

    actions.chrome_gmail = function()
        os.script(
            "on is_running(appName)",
                "tell application \"System Events\" to (name of processes) contains appName",
            "end is_running",
            "set chromeRunning to is_running(\"Google Chrome\")",
    
            "on doSwitch()",
                --Set the URL of the website here
                "set URLtoLookAndGoto to \"https://mail.google.com\"",
                "tell application \"Google Chrome\"",
                    "set j to 0",
                    "set foundit to false",
    
                    -- repeat-clause (deleted)
    
                    "tell application \"Google Chrome\"",
                        "activate",
                        "open location URLtoLookAndGoto",
                    "end tell",
                "end tell",
            "end doSwitch",
    
            "if chromeRunning then",
                "doSwitch()",
            "else",
                "activate application \"Google Chrome\"",
                "delay 4",
                "doSwitch()",
            "end if"
        );
    end
    

    Even the following simple repeat clause breaks the server:

        "repeat with w in (windows)",
            "set j to j + 1",
        "end repeat",
    

    Any idea?

    posted in Q&A read more
  • Alex

    I have a button that has a lot of different text-values and I want to do some things only if the button has a specific value. But if getting the value isn't possible I will use some workaround.

    posted in Q&A read more
  • Alex

    Hi community members :)

    does anybody know how to get the value of a layout property in lua?

    You can set the value of a layout property in lua with:

    layout.{id}.{property} = {value};
    

    The following example would set the text of the button <button id="myFirstButton" ontap="doFirstAction" text="" /> to "Press me":

    layout.myFirstButton.text = "Press me";
    

    I thought I could get the property of a button in the same way and use it for an if statement:

    if layout.myFirstButton.text ~= "Press me" then
    

    but that doesn't work.

    Any ideas?

    Cheers
    Alex

    posted in Q&A read more
  • Alex

    On OS X it would be alt+shift+7
    Maybe that works on windows too.

    posted in Q&A read more
  • Alex

    Is it possible to set the font-color of a button in the layout file?
    Something like:

    <button ontap="dojob" text="Button Text" font-color="#222222"/>
    

    posted in Q&A read more

Internal error.

Oops! Looks like something went wrong!