MyQueries app instructions, user guide, query creation and launch, suggestions, examples, guidelines
MyQueries is a useful mobile app for easily retrieving and launching common and/or customized queries for the life in the city, or even other purposes.
Queries are either simple phrases or cleverly parametrized strings of text that can be used to compose AI prompts, searches, web urls, deep links or Google Maps searches, or HTML code for the WebView.
Queries can be very useful.
For example, in fact, very often you will find that cities have different apps or websites that users have to go to get bus-stop real-time information, not to mention when official apps or mainstream apps have cumbersome user-interface, show irrelevant information or ads that prevent you from timely gathering the needed information; or maybe you have to use different systems when you leave home in the morning and when you want to be back.
So you can have general purpose queries (like ones named "FROM MY POSITION TO ..." showing public transport time-tables of bus stops around you for a parametrized destination) or frequently used ones with recurring or useful routes (like ones named "DOWNTOWN" or "BACK HOME FROM HERE", "GO TO WORK" and so on).
(Capital letters are used here for clarity purposes but you can use whatever lower/uppercase style you prefer)
You can create queries with text, location and time parameters which will be evaluated at the time you launch the queries.
On a phone, or a tablet in portrait mode, just tap a query to launch it. On a tablet in lanscape mode the screen is divided in two areas: the query list is on the left, and tapping a query will show its editing screen on the right.
Long-press on a query to display its pop-up menu, then select "edit" if you want to modify it. On a tablet in lanscape mode select "go" to launch the query.
Creating and editing a query
To create a new query you have to tap the circular + button.
You can create queries to display bus timetables, restaurants or cultural events near you, open groceries, and so on.
IMPORTANT: Do not enter your exact home address, coordinates, password or other sensitive information in queries.
To have encryption on your device is the best way to protect you data as much as possible.
You have to enter a title (mandatory), for example "FROM MY POSITION TO ...". The title will appear in the list of queries on the main screen (if no HTML launch-view is created).
In the query editor screen you easily enter parameter symbols within the query string (the value will replace the symbol when the query is sent to search/app/browser).
Symbols are inserted if you are editing the query string, that is, only when the text cursor is in the field.
You can also:
-enter tags to easily categorize and retrieve queries
-save, duplicate or clear the current query
-access the advanced HTML editor for the launch-view.
You can launch the query you are editing also by pressing the app-icon button on the right.
If you are using a tablet, the query editor is available in three sizes: small size in landscape mode when it's on the right, medium size in portrait mode, big size when changing orientation to landscape mode. Two sizes are available on phones, in portrait and landscape mode.
The query can contain separated lines of text, that will be concatenated and processed as a single line.
Location parameters refer to the current GPS device position and are available in every suitable lat/long format, like 44.4943643,11.3406716 or 44°29'40.26588"N 11°20'40.866"E and so on (you can choose and personalize the desired format). The default format is suitable for search/Google Maps queries.
If you need the coordinates of a certain place to be in your query, not as a parameter but as a string, put the location symbol in the editing field and press the app-icon button on the right, you will find the coordinates in the opened app, then copy&paste the corresponding string.
Time parameters also are available in several (customizable) formats and encompass + or - a certain amount relative to the "now" time, if needed.
When one or more text parameters are in the query, the user is prompted to enter them with a slick interface (typing and voice input are both available).
PUBLIC TRANSPORT FROM location_on TO format_quote
The above text is the query string, that you type in the query field.
(if you do not see the icons here, please check the internet connection)
Text parameters are available in different modes (with slightly different icons):
- variable (the user is prompted every time the query is launched)
- fixed (the user is prompted just the first time to set the fixed value for the subsequent launches, useful when importing/exporting queries so private data does not come along the query itself, if necessary they can be reset by the user to be entered again)
- predetermined (the user is never prompted, the value is set by the query author, so the text value does not encumber the query itself).
- options (with a default value and other ones corresponding to the "option tags", see below. For example tag1:option1,tag2:option2)
Options and predetermined text parameters are available also for the launch-view (see below).
You can select one of the available targets for the query: Search, Url (also for deep links), Google Maps, Webview, Bing AI.
Queries for search or Google Maps can be written in natural language thanks to Artificial Intelligence (AI technology is constantly refined).
PUBLIC TRANSPORT FROM MY POSITION TO format_quote
Urls and deep links
If you want a query that sends an url or a deep link, you have to copy/paste the url in the editing field and replace suitable character ranges with parameter symbols.
Example: if the app/website you have to use for the bus-stop timetable is so naive to show only results from the exact "now" time on, but fortunately its web url/deep link has the time parameter in it, you can insert the symbol of time parameter in place of the time-value characters and choose a negative time-delta of 5 minutes (for example) to include more results.
You can launch urls or deep links without parameters too, as a shortcut for something.
The Webview target
If a query is for the Webview target its text has to be HTML/CSS/JS code, so you can create informative panels with embedding, async requests or other features.
The Webview target is useful to overcome the limitations of current apps and webpages to provide complex and rich information as actually needed.
It is up to you to assign tags to queries, according to your habits and needs, the "Tags" and "List tags" fields are for that (ou can enter multiple tags for a single query, separated by , comma or ; semicomma), and the "options" text parameters (see above).
"Tags" are about what a query does.
"List tags" are useful for grouping queries according to their origin or other convenience, very often one is enough and usually third-party lists should be provided with one specific list tag assigned to all queries so they can be treated as a whole.
When "Tags" and "List tags" are checked the ordering of queries in the list depends on them.
"Option tags" instead do not affect the ordering of queries in the list but set a choice.
"Travel mode" options are available as predefined text parameters. They are in the MyQueries guidelines so they will be displayed as icons. You should use such preset parameters if you need "travel mode" options in the query or in the launch-view (option values are the GMaps "travel mode" values in the query, and the icon names in the launch-view).
When "Option tags" are checked, the corresponding option is used in queries or launch-views, according to the "options" text parameters which are suitably set (see above). Usually they let the user set a preference, like "transit", "walking", "bicycling", "driving" to have the associated values in the query, as requested in some urls for example, or in the launch-view HTML. If no option tag is checked among the ones belonging to the query, the default value is used for the text parameter.
Options help not to have duplicate queries.
More flexibility comes from the conditional directives, based on option tags too (see below).
By checking one or more tag-filters (they are automatically created out of tags and parameters in queries), most relevant queries will surface up in the list, so they are available when you need them, and the options are set.
List tags and option tags have a slightly different appearance so they can be easily spotted.
When a tag-filter is checked after another, its tagged queries surface. Results are always useful and relevant.
Usually you want that some tag-filters stay selected when you are in a particular context for a certain period of time:
for example if you commute between two cities, or in the case you are often guest in another city, just select the city tag-filter at arrival, so that customized queries for the place are made prominent, then check/uncheck other tags according to your needs.
When some tag-filters are selected, corresponding queries are "selected" too: they are now in the top positions of the list and have a vertical line on the left that indicate them. They can be exported or deleted as a group.
Long-press on a tag filter to show its pop-up menu. You can edit or remove the represented tag, meaning that such actions will permanently modify saved tags in the corresponding queries and parameters. You can also use a tag as "Negative" (only for tags and list tags), so to exclude the corresponding queries from the current selection (also useful to refine a selection to be exported). You can uncheck the tag to bring it back to the normal function, or choose "Reset" from pop-up menu.
Every time a query is launched it is also stored so that it can be launched again (you can access the "Recent queries" screen by tapping the "history" button on the top).
For instance, you can launch the same "transit info" query from different places during your travel without having to enter the "destination" parameter again, with current position and options.
Recent queries are displayed in a textual form with title and parameters. Just tap a query to launch it. Some queries have no parameters.
But when a query has (variable) text parameters you can save it as a stand-alone query to be present in the list. Tapping on the "add" symbol near the title you can edit the query, you can also customize it before saving (or later).
Queries have their context menu (long press on the launch view), choices are: "Edit", "Go", "Delete", "Move", "Export", "Reset fixed values", "Create nested query HTML".
You can move queries up and down in the list, and also when they are ordered by tags, but consider that the new position will have effect on every other ordering.
Each query has a launch-view. You can customize it with HTML, so it can have a special appearance (fonts or whatsoever), icons, images.
The query launch-view can also consists of an HTML widget with some information on it so you can get information just glancing at the list.
If you are not an advanced user, if you do not know about HTML, or just do not want to bother, the HTML editor still allows you to customize the launch-view with simple templates.
You can edit templates very easily. Press the HTML editor button. In the HTML editor screen you have editing fields for title, image src address, icons.
Title is already populated with the title value but can be changed (it affects created HTMl only).
Image src address is empty because you have to copy/paste it from your source (like one you can find on the internet).
Icons can be inserted by means of accessing the icons view (press the icons button). You can also use the "icons backspace button" to delete the last icon on the right.
When the desired fields are populated you can create the HTML from one of the temmplates.
And you can further edit or customize the HTML code, if you want. Tap the Test/Update button to see the resulting appearance. HTML resources are cached.
Press the button on the right ("Set LaunchView HTML") when you are done editing the HTML and want it to affect the actual appearance of the query.
The edited HTML text is saved even if you do not set, to be able to edit it later.
When entering the HTML Editor screen the HTML text will be restored for further editing, but remember it is not necessarily the launch-view code. That is only updated when you set it.
You can edit the current launch-view code by means of pressing the "Edit current LaunchView HTML" button, and you have to set it again after the editing to actually see it in the launch-view.
You can also copy and paste an HTML widget code, but be sure it is from a trusted source, because you could have malicious code or ads inside the HTML. See the app liability disclaimer from the authors.
Also ensure that no sensitive information are in the HTML code like, for example, username, password, exact address or coordinates.
Take into account that in some cases the HTML code has to be edited and adjusted to suitably appear in the query list.
In some cases you can find ready-made queries or ready-made widgets for MyQueries on the web. Again, it is important that you use only what you get from trusted and reliable sources. See the app liability disclaimer from the authors.
Note that some widgets are not automatically updating, also they could be incompatible.
Accuracy and refresh of widget data, layout and responsiveness may depend on the quality of the widget code itself and the internet connection nonetheless, but not the MyQueries app itself.
Exporting and importing queries
Although automatic backup is enabled, it is recommended to backup the query list when you have a certain number of queries, or your queries are very clever and complex. Or also you could want to transfer some queries (or the entire library) to another device. If you make a lot of query editing you can use tags like "tablet", "phone" to organize your work.
It's recommended to assign a specific tag for queries to be exported for a definite purpose (for instance, to provide another person a list of query) so they can are easily spotted after being imported.
You can save or share all queries, single queries, or the queries that are in the top positions after some tag-filters are checked (a vertical line on the left indicate them).
You will be prompted to insert a file name and select save or share, then you will have to select the destination folder (save), or one of the available sharing options (share). The created file is a json file with .myq extension.
You can also import queries. You will be asked to select the file to import, which can contains one or more queries.
Files can be on the device, on the SD-Card, on the cloud.
Imported queries are appended. If you want to replace your current library you should delete all current queries before.
A confirmation is required for this kind of operation.
It is possible to include nested queries inside a main query, that is, inside its launch-view.
In general a nested query is something like:
<script class="myqueries-query-json" type="text/json">
A nested query is an autonomous (inline) custom HTML element with custom html tag myqueries-query (mandatory) that is HTML5 compliant, and can contain HTML elements inside. These elements are the "launch-view" of the nested query within the main launch-view, so that when the user taps on one nested query it is launched accordingly to the query JSON that is contained in the script with class="myqueries-query-json" (mandatory) and type="text/json" (mandatory). Opening and closing html tags are both mandatory.
A nested query can be positioned inside the launch-view of the main query (the containing query) as one of its HTML elements. A nested query is usually created from an existing query in the list, by selecting the "Create nested query HTML" entry from the pop-up menu.
The HTML created out of the query is then copied into the clipboard so the user can paste it into the HTML editor for the launch-view of the main query, when it is in editing.
The JSON script is included in the HTML but some fields are ignored. For example, the Tags and the List tags (belonging to the query, not the html tags) will be not relevant for the list ordering because the nested query is inside the main query.
Also the launchViewHTML field is ignored because the nested query will be represented by the HTML inside its html tags instead.
Usually nested queries complement the main query, for example they will form a row of small icons with different functions (queries) that is placed at the bottom. It is also possible that one of these icons refers to the main query itself, so it is not a nested query at all because it is a redundant part of the main launch-view.
Take into account that the nested queries will go in the recent queries list when launched, and they can also be added to the library. In this case all JSON fields will be relevant because the query is now stand-alone, and its original launch-view will be displayed.
Sometimes the ignored fields are empty for simplicity (they were empty in the very query used to create the HTML), sometimes it is good to have them set in case the nested query is added to the list. This can happen, for example, when the user gets some queries from a third party and would like to have a nested query as stand-alone (the queries are prepared suitably).
If the nested query JSON is not complete or wrong an error will be displayed when the query is launched.
Note: the HTML of the nested queries inside the main query launch-view is subjected to the parameters that can be inserted.
Option tags are also useful for implementing conditional directives, that is, determining which query portions or launch-view portions will be included, with contained characters and "normal" parameters, according to the checked option tags. This is useful for parametrizing urls to perform a different request, or create a different query (i.e. calling a different app or service), or making the launch-view appear differently.
This is done inserting the conditional parameters within the query text. They have their own icons, choose one of them in the dialog that opens by tapping the button for the conditional directive in the editing screen, insert the parameter label (optional) and the condition.
If, ElseIf (Not), EndIf parameters are available. Sometimes they form a complete triad: what comes after the If symbol (and before the ElseIf) will be included in final the query string (characters and other parameters), while what comes after the ElseIf symbol (and before the EndIf) will be not included, when the condition is true.
I this case, checking an option tag will not cause the insertion of a text value in the query string, but it will determine the parts that the query will be made of, in horizontal chunks, that are already present in the query text.
The condition in fact is the tag name, that can be entered when inserting the conditional symbols (the option tag will be created if not already present in any other queries). The true/false condition will correspond to the option tag being checked or not checked.
When the condition is omitted for the ElseIf, then the preceding If condition will be used. If the ElseIf is independent it must have a different option, thus acting as Not.
More than one triad can be placed within the query text, complete or incomplete. ElseIf can start a triad itself, in which case it must have its own condition.
Note: Triads have not to be necessarily complete, indeed it is not mandatory that they are made of all the three conditional symbols, for example you can have just an ElseIf followed by EndIF (the If is omitted because it corresponds to an empty range). In the same fashion you can also have If followed by EndIf, without ElseIf.
In fact EndIf itself is not mandatory. If the EndIF symbol is omitted, the directive just ends when another independent conditional symbol is encountered, or it is intended to include all the remaining text.
So, both If and ElseIf can start a triad, but this is considered complete if other symbols are encountered that start a new one.
Moreover, an empty condition for the If means always "false" (that is, "do not include"), while an empty condition for the ElseIf means always "true" (that is "do include").
By combining the conditional symbols together, and setting suitable tag options as their conditions, you can create logical operations (although the simplest ones are often used). You have to consider them in sequence, because only characters and "normal" parameters (text, options, location, time) make sense in the encompassed text, while the conditional symbols just set the ranges.
After being launched, conditional queries too are found in the "Recent queries" screen. They can be launched again with different options according to which option tags are now checked.