Digital Dashboards
Public Group
Public Group
Active 2 weeks ago
Sharing complex project data is crucial to successful project management. This group is focused... View more
Public Group
Javascript for Digital Dashboards
Tagged: Javascript for Dashboards
-
Javascript for Digital Dashboards
Posted by Doug McLean on March 13, 2021 at 3:32 pmI have a collection of Dashboards that I use for my projects. They all have the same basic layout and have buttons for various places that I want to link too.
Our folder structure is also set up in a consistent manner.
Does anyone have any JavaScript that I can run to automatically set these links up so I don’t have to set up 10 hyperlinks every time I use one of my Dashboards?Liz Larsen replied 1 year, 5 months ago 7 Members · 22 Replies -
22 Replies
-
Points: 2,608Rank: UC2 Brainery Orange Belt
I have used JavaScript for making dashboards more dynamic, but I don’t know of a way to automate the creation of hyperlinks. I do have an idea that might work, but it depends on how your files are named. Are the files always named the same thing (Drawings.pdf, Specifications.pdf, etc.) or are they project-specific (ProjectName_Drawings.pdf, ProjectName_Specifications.pdf, etc.) or do they have random names every time?
-
Points: 14,556Rank: UC2 Brainery Blue Belt IIII
Yes, most of them are the same.
They will go to a specific sub folder within our Estimate folder.
Everything is consistent. Everything is all contained within the same parent folder.
-
Points: 26,080Rank: UC2 Brainery Advanced Brown Belt
Looking back through some older threads and saw this one @Doug McLean (have to study history so I know where to get my hyperlinks from for @Vince ). Did you find a way to simplify this process? If not, perhaps some of those who have joined the Brainery since your original post might have some ideas.😎
-
-
Points: 4,855Rank: UC2 Brainery Orange Belt IIII
I’m still working on it. My optimism fades, though.
Any method I think of, there are security reasons for disabling JavaScripts ability to do it. Such as JavaScript being able to open folder leads to the possibility of inserting malicious code onto your computer.
Like, I get it. But at the same time I’m frustrated because I have it planned out in my head and it would be possible if not for security reasons. Ugh.
-
-
-
Points: 23,102Rank: UC2 Brainery Brown Belt III
@Doug McLean What are you trying to automate? I’ve seen lots of digital dashboard strategies, here is what I’ve always done:
- Create a template project folder structure, Saved on your network.
- Save the Template Dashboard in the root directory of that project.
- Create all the links, and make sure all your links are set to Relative.
- When a new project comes in, make a duplicate where you save your project data, whether that’s a network location or Studio Project. All the paths should remain if you move the entire thing together.
I saw a video a year ago using javascript to turn layers on/off on a dashboard. I didn’t really understand why they took that approach. It’s a lot easier to create several pages that look different, than to script hiding things on one page.
I’d love to hear what ideas you guys picked up from @mechave presentation. Digital Dashboards are one of my favorite things to do in Bluebeam.
-
Points: 4,855Rank: UC2 Brainery Orange Belt IIII
Coincidentally, my newest video (debuting tomorrow!) goes over a dashboard that uses JavaScript to hide and show layers.
And you’ll see exactly why JavaScript was used here, rather than creating a bunch of similar pages.
(P.S. if anyone needs help adding JavaScript to their dashboards, come see me)
-
-
Points: 14,556Rank: UC2 Brainery Blue Belt IIII
the folder structure is set, that’s not the issue, its the location of that folder structure within our Jobs/ Estimating Drive.
Every project has a different starting location, which is the main problem really, even being on SharePoint.
It would just be nice to not have to set up those initial links.
-
Points: 23,102Rank: UC2 Brainery Brown Belt III
I’m really pulling at straws here, but if you go to the Hyperlink Panel you could Edit Action and paste the Root folder into the front of the path…. For each one… I know….
Maybe there could be a script for that @lizlarsen
-
Points: 4,855Rank: UC2 Brainery Orange Belt IIII
This is exactly one of the things I’m looking at.
With writing JavaScript in Bluebeam, there’s the eternal questions of:
- Does my code not work because I wrote it wrong?
- or
- Does my code not work because it’s not possible?
With such limited documentation available for what I’m doing, I have no idea if I should continue down some pathways in an attempt to fix my code, or if that will be a fruitless endevour.
-
Points: 26,080Rank: UC2 Brainery Advanced Brown Belt
Perhaps the question needs to be “what do I need to break to make this work?” @lizlarsen 😎
-
Points: 7,730Rank: UC2 Brainery Purple Belt II
This is pretty frustrating, it looks like one way to do this would be to place a field on the page to collect the base of the address, then concatenate with a set of standard relative links. Couple of problems I am running into playing with this, and maybe you can expand Liz:
So there is no way that I can see to manipulate active hyperlinks as they are not named form fields, and as noted earlier, Revu has not made a method available to create link.
The work around that I see would be to set the action of buttons or other dashboard items. Unfortunately I am having issues getting the second half of my “setAction” command to work. I am pretty unfamiliar with the usable function calls here, but I have tried a couple, icluding this one, which seemed the most obvious:
(simplified without concatenating for now, just trying to get the base to work)
// Get the value of the form field
var fieldValue = this.getField(“Text1”).value;
// Set the action of the button to follow the hyperlink on MouseUp
this.getField(“Button1”).setAction(“MouseUp”, “this.getDoc().launchURL(\”” + fieldValue + “\”);”);
-
Points: 7,730Rank: UC2 Brainery Purple Belt II
ok got the base of this working, let me know if I’m on the right track or if you need to do this a different way before I take it any further:
Global code:
function launcher() {
var link = this.getField(“Text1”).value
app.launchURL(link);
}
Button code (mouse up, javascript)
launcher()
If this is the right idea, we can take an input and concat with a set of standard relative locations.
Alternatively, we can use the openDoc method instead of launchURL if we want to open in Revu.
-
Points: 7,730Rank: UC2 Brainery Purple Belt II
Ok getting more into the weeds of what Liz was referring to with security:
I tried to add a “File//” at the beginning in order to call file explorer if trying to go to a directory. it seems to concat just fine, but gave me a security error when I tried to execute.
It WILL however concatenate to open a specific file, i.e.:
var dataLink = this.getField(“Text1”).value + “M0-22CD Schedules Area CD.pdf”;
app.openDoc(dataLink);
This works and open up right in Revu, BUT it freezes the program for some random reason
Here is the File explorer code if anyone wants to play:
function launcher() {
var dataLink = “file://” + this.getField(“Text1”).value + “/DATA”;
app.launchURL(dataLink);
}
-
Points: 4,855Rank: UC2 Brainery Orange Belt IIII
I’ll have to take a look at this over the weekend.
I do agree with you that manipulating hyperlinks is not a function that Bluebeam has allowed with their JavaScript API. I like your workaround to use buttons, but it’d be nice to just straight be able to insert hyperlinks.
-
Points: 7,730Rank: UC2 Brainery Purple Belt II
I think technically you could accomplish it through the A-word, but would be annoying to have to use that every time to update links. Hopefully that API expansion is coming soon and is not a let-down.
-
Points: 4,855Rank: UC2 Brainery Orange Belt IIII
Hopefully that API expansion is coming soon and is not a let-down.
Yeah….. My optimism on this has lowered over the past several weeks.
-
Points: 7,730Rank: UC2 Brainery Purple Belt II
A small update to this, I tried to play with some of the trust settings to see if it could be a reason, but no luck. Added the network drive and the specific folder, but still get a security error.
-
Points: 4,855Rank: UC2 Brainery Orange Belt IIII
I have also had no luck when trying to modify trust settings (in previous projects, I haven’t tried recently).
-
-
-
-
Log in to reply.