Current Projects buttons (+hotkeys)

Hi there,
Very simple,
As I work on say 3 or 4 projects for maybe a few days to a month I use these buttons with hotkeys (1-5) which work great for 'current' projects. It's quicker than constantly updating favourites etc. Might be helpful to people.
For instance 1 = Current, highly active project etc. 2,3,4 descending.
I might set 2 to another project that I get less calls about. Like all work it's transient and changes so my '1' folder in a few weeks would be something else. Shift click sets the folder, and obviously I would set the hotkey to 1 in the button, and so on for 2-5. I have attached a .zip with the pngs which are skinny so don't take up too much toolbar space.

Below is code for 'folder1' so you would update each 2 to 5.

image
image
aed_Quick1.zip (4.0 KB)

//Shift + click will set the folder project.

//No modifier down////////////////////////////////////////////
@keydown:none  
Go  {$glob:folder1} TABFINDEXISTING  

//if shift down set global var to source path////////////////////
@keydown:shift    
@set glob!:folder1 = {s} 
{dlgstring|  folder1 has been set to : |{$glob:folder1}   }

4 Likes

would be nice with come labels huh? Well maybe in DOpus 14

You can already add labels if you want them.

My apologies for not explaining more clearly. i meant dynamic labels. Like a variable or something to change to set the label of the button, so you know which project is selected.

That can be done in Opus 13 using Evaluator Button Labels [Directory Opus Manual].

Quick example, where the button label will change to the path where you last clicked the button:

@set glob!:folder1={sourcepath|noterm}
@toggle:update
@label=Val("$glob:folder1")
1 Like

I use all kinds of custom buttons for locations, like normal bookmarks. The idea of this is just the 'most active' projects based on 1-5. Sounds like you want normal bookmarks or location buttons.

Oh, nice thx, gonna try that!

Here is my version of a method to easily create on-the-fly access to files or folders.

Features:

  1. allows for a large number of files or folders
  2. mouse driven
  3. two clicks opens a file or folder
  4. two clicks adds a selected file or folder to the list
  5. requires only the button below and a folder of your creation to store the automatically created links to the files or folders
  6. folders are listed before files

The button is a three button button:
LMB - opens the list of files and folders to access
RMB - adds the currently selected file or folder to the list
MMB - opens the list to manually rename or delete any items in the list.

You will need to edit the button to point to the folder you create to store the automatically created links to the files or folders.

Quick Links.dcf (1.5 KB)

1 Like

Great idea. Thanks for sharing!

I have made two improvements:

  1. Now works for onedrive folders.
  2. Better labels (includes only folder name, not full path).

I have found these to be a useful alternative to favorites, or for 'pinning' folders for later return.

I tried to make it work for files as well, possibly via creating intermediary shortcuts, but have been unsuccessful thus far.

aed_Quick1.dcf (1.4 KB)

Here is a front end for the Current Project all five buttons as a menu button.

The five buttons look like this:

I added three menu button icon options:

All icons are available in this icon .dis file:

Numbers (32px & 24px).dis (41.7 KB)

Here is the button:

Current Projects Toolbar.dcf (7.5 KB)

Add the button to a toolbar and the .dis file to the Opus icons folder. You're good to go.

Here is the code:

<?xml version="1.0" encoding="UTF-8"?>
<button 3dborders="no" backcol="none" display="label" icon_size="large" label_pos="right" popout="right" separate="yes" textcol="none" type="menu">
	<label>Current Projects Toolbar</label>
	<icon1>#Numbers_(32px_&amp;_24px):Project Menu 1</icon1>
	<button 3dborders="no" backcol="none" display="label" hotkey_label="yes" icon_size="large" label_pos="right" textcol="none">
		<label>Unassigned Current Project 1</label>
		<tip>Ctrl+click to set new project folder</tip>
		<hotkeys>
			<key>1</key>
			<key>num1</key>
		</hotkeys>
		<icon1>#Project1</icon1>
		<function type="normal">
			<instruction>// Project folder button – click to jump, Ctrl‑click to set</instruction>
			<instruction>// -------------------------------------------------------</instruction>
			<instruction />
			<instruction>// --- Jump (no modifier) -------------------------------</instruction>
			<instruction>@keydown:none</instruction>
			<instruction>@ifset:$glob:folder1</instruction>
			<instruction>Go &quot;{$glob:folder1|q}&quot; TABFINDEXISTING</instruction>
			<instruction>Go TABLOCK=lockchanges</instruction>
			<instruction>@ifset:else</instruction>
			<instruction>@confirm No project folder defined yet! | OK</instruction>
			<instruction>@endif</instruction>
			<instruction />
			<instruction>// --- Define (Ctrl‑click) -------------------------------</instruction>
			<instruction>@keydown:ctrl</instruction>
			<instruction>@set glob!:folder1={sourcepath|noterm}</instruction>
			<instruction>@toggle:update</instruction>
			<instruction>@label:= ($glob:folder1) // evaluator runs every toolbar refresh</instruction>
			<instruction>//To display only the filename, use FilePart($glob:folder1)</instruction>
		</function>
	</button>
	<button 3dborders="no" backcol="none" display="label" hotkey_label="yes" icon_size="large" label_pos="right" textcol="none">
		<label>Unassigned Current Project 2</label>
		<tip>Ctrl+click to set the new project folder</tip>
		<hotkeys>
			<key>2</key>
			<key>num2</key>
		</hotkeys>
		<icon1>#Project2</icon1>
		<function type="normal">
			<instruction>// Project folder button – click to jump, Ctrl‑click to set</instruction>
			<instruction>// -------------------------------------------------------</instruction>
			<instruction />
			<instruction>// --- Jump (no modifier) -------------------------------</instruction>
			<instruction>@keydown:none</instruction>
			<instruction>@ifset:$glob:folder2</instruction>
			<instruction>Go &quot;{$glob:folder2|q}&quot; TABFINDEXISTING</instruction>
			<instruction>Go TABLOCK=lockchanges</instruction>
			<instruction>@ifset:else</instruction>
			<instruction>@confirm No project folder defined yet! | OK</instruction>
			<instruction>@endif</instruction>
			<instruction />
			<instruction>// --- Define (Ctrl‑click) -------------------------------</instruction>
			<instruction>@keydown:ctrl</instruction>
			<instruction>@set glob!:folder2={sourcepath|noterm}</instruction>
			<instruction>@toggle:update</instruction>
			<instruction>@label:= ($glob:folder2) // evaluator runs every toolbar refresh</instruction>
			<instruction>//To display only the filename, use FilePart($glob:folder2)</instruction>
		</function>
	</button>
	<button 3dborders="no" backcol="none" display="label" hotkey="3" hotkey_label="yes" icon_size="large" label_pos="right" textcol="none">
		<label>Unassigned Current Project 3</label>
		<tip>Ctrl+click to set new project folder</tip>
		<icon1>#Project3</icon1>
		<function type="normal">
			<instruction>// Project folder button – click to jump, Ctrl‑click to set</instruction>
			<instruction>// -------------------------------------------------------</instruction>
			<instruction />
			<instruction>// --- Jump (no modifier) -------------------------------</instruction>
			<instruction>@keydown:none</instruction>
			<instruction>@ifset:$glob:folder3</instruction>
			<instruction>Go &quot;{$glob:folder3|q}&quot; TABFINDEXISTING</instruction>
			<instruction>Go TABLOCK=lockchanges</instruction>
			<instruction>@ifset:else</instruction>
			<instruction>@confirm No project folder defined yet! | OK</instruction>
			<instruction>@endif</instruction>
			<instruction />
			<instruction>// --- Define (Ctrl‑click) -------------------------------</instruction>
			<instruction>@keydown:ctrl</instruction>
			<instruction>@set glob!:folder3={sourcepath|noterm}</instruction>
			<instruction>@toggle:update</instruction>
			<instruction>@label:= ($glob:folder3) // evaluator runs every toolbar refresh</instruction>
			<instruction>//To display only the filename, use FilePart($glob:folder3)</instruction>
		</function>
	</button>
	<button 3dborders="no" backcol="none" display="label" hotkey="4" hotkey_label="yes" icon_size="large" label_pos="right" textcol="none">
		<label>Unassigned Current Project 4</label>
		<tip>Ctrl+click to set new project folder</tip>
		<icon1>#Project4</icon1>
		<function type="normal">
			<instruction>// Project folder button – click to jump, Ctrl‑click to set</instruction>
			<instruction>// -------------------------------------------------------</instruction>
			<instruction />
			<instruction>// --- Jump (no modifier) -------------------------------</instruction>
			<instruction>@keydown:none</instruction>
			<instruction>@ifset:$glob:folder4</instruction>
			<instruction>Go &quot;{$glob:folder4|q}&quot; TABFINDEXISTING</instruction>
			<instruction>Go TABLOCK=lockchanges</instruction>
			<instruction>@ifset:else</instruction>
			<instruction>@confirm No project folder defined yet! | OK</instruction>
			<instruction>@endif</instruction>
			<instruction />
			<instruction>// --- Define (Ctrl‑click) -------------------------------</instruction>
			<instruction>@keydown:ctrl</instruction>
			<instruction>@set glob!:folder4={sourcepath|noterm}</instruction>
			<instruction>@toggle:update</instruction>
			<instruction>@label:= ($glob:folder4) // evaluator runs every toolbar refresh</instruction>
			<instruction>//To display only the filename, use FilePart($glob:folder4)</instruction>
		</function>
	</button>
	<button 3dborders="no" backcol="none" display="label" hotkey="5" hotkey_label="yes" icon_size="large" label_pos="right" textcol="none">
		<label>Unassigned Current Project 5</label>
		<tip>Ctrl+click to set new project folder</tip>
		<icon1>#Project5</icon1>
		<function type="normal">
			<instruction>// Project folder button – click to jump, Ctrl‑click to set</instruction>
			<instruction>// -------------------------------------------------------</instruction>
			<instruction />
			<instruction>// --- Jump (no modifier) -------------------------------</instruction>
			<instruction>@keydown:none</instruction>
			<instruction>@ifset:$glob:folder5</instruction>
			<instruction>Go &quot;{$glob:folder5|q}&quot; TABFINDEXISTING</instruction>
			<instruction>Go TABLOCK=lockchanges</instruction>
			<instruction>@ifset:else</instruction>
			<instruction>@confirm No project folder defined yet! | OK</instruction>
			<instruction>@endif</instruction>
			<instruction />
			<instruction>// --- Define (Ctrl‑click) -------------------------------</instruction>
			<instruction>@keydown:ctrl</instruction>
			<instruction>@set glob!:folder5={sourcepath|noterm}</instruction>
			<instruction>@toggle:update</instruction>
			<instruction>@label:= ($glob:folder5) // evaluator runs every toolbar refresh</instruction>
			<instruction>//To display only the filename, use FilePart($glob:folder5)</instruction>
		</function>
	</button>
</button>

1 Like

I have further improved the buttons.

They now allow you the option of setting the current directory, or the highlighted folder/file (now allows files to be pinned).

Code:

// Project folder button – click to jump, Alt‑click to set
// -------------------------------------------------------

// --- Jump (no modifier) -------------------------------
@keydown:none
@ifset:$glob:folder1
Go "{$glob:folder1|q}" TABFINDEXISTING
Go TABLOCK=lockchanges
@ifset:else
@confirm No project folder defined yet! | OK
@endif

// --- Set Current Folder (Alt‑click) -------------------------------
@keydown:ctrl
@set glob!:folder1={sourcepath|noterm}
@toggle:update
@label:=FilePart($glob:folder1) // evaluator runs every toolbar refresh

// --- Set Highlighted Folder (shift‑click) -------------------------------
@keydown:shift
@firstfileonly
@set glob!:folder1={filepath$|noterm}
@toggle:update                 // forces all @label/@icon tests to re-evaluate

I think I’ve found the best use case. Project tabs. Seems to be the fastest navigation I’ve come across.

ProjectBar.dop (9.4 KB)

Centered, fixed width, added set with hotkey (tab+1, 2, 3 etc.). Added visual indicator of active tab.

UpdatedProjectBar.dop (20.1 KB)