Empty Project Macro Tags
Empty Project Macro Tags
I'm trying to pass my active project information to a batch file using the project macro tags and they all appear to be empty.
The tags I'm referring to are:
$ProjectBase or $PB
$ProjectDir or $PD
$ProjectDrive or $PDR
$ProjectDriveDir or $PDD
$ProjectFile or $Pf
I am using Zeus version 3.97j
Thank you.
The tags I'm referring to are:
$ProjectBase or $PB
$ProjectDir or $PD
$ProjectDrive or $PDR
$ProjectDriveDir or $PDD
$ProjectFile or $Pf
I am using Zeus version 3.97j
Thank you.
I created the following Lua macro to show how to query the project details via a macro script:
For me this macro is working as expected and returning sensible values.
Cheers Jussi
Code: Select all
function key_macro()
local message_text = ""
-- Project file base name (excludes file extension)
message_text = message_text .. "\nProject Base" .. " = " .. macro_tag("$PB" )
-- Project file drive and directory (includes '\')
message_text = message_text .. "\nProject Drive Dir" .. " = " .. macro_tag("$PDD")
-- Project file extension (includes '.')
message_text = message_text .. "\nProject Ext" .. " = " .. macro_tag("$PE" )
-- Project file name
message_text = message_text .. "\nProject File" .. " = " .. macro_tag("$PF" )
-- name of all projects
all_projects = projects()
-- name of the active project
project_name = project_active()
-- files in the active project
files = project_files(project_name, 0, "\\n")
message_text = message_text .. "\n\n"
message_text = message_text .. "\nAll Project Names" .. " = " .. all_projects
message_text = message_text .. "\nActive Project Name" .. " = " .. project_name
message_text = message_text .. "\nActive Project Files:\n" .. files
message_box(1, message_text, "Zeus Macro Tags")
end
key_macro() -- run the macro
Cheers Jussi
Here are my results from running the ztag.lua macro.
https://docs.google.com/open?id=0Bz1Mt2 ... VlJWWhqcDQ
https://docs.google.com/open?id=0Bz1Mt2 ... nVEVkJiSjA
Thank you for your assistance.
https://docs.google.com/open?id=0Bz1Mt2 ... VlJWWhqcDQ
https://docs.google.com/open?id=0Bz1Mt2 ... nVEVkJiSjA
Thank you for your assistance.
What version of Zeus are you running 
When open the project and workspace files that you provided and run the macro I get the expected results as shown below:

When open the project and workspace files that you provided and run the macro I get the expected results as shown below:
Code: Select all
---------------------------
Zeus Macro Tags
---------------------------
.....
Current Dir = E:\testing\
.....
Project Base = Dashboard
Project Drive = E:
Project Drive Dir = E:\testing\662btn\
Project Dir = \testing\662btn\
Project Ext = .zpi
Project File = E:\testing\662btn\Dashboard.zpi
---------------------------
OK
---------------------------
Silly me. You mentioned that earlier in the thread
What happens if you run the test.lua code:
Cheers Jussi

What happens if you run the test.lua code:
Code: Select all
function key_macro()
-- create a new file
FileNew();
local message_text = ""
if is_workspace_open() then
-- Project file base name (excludes file extension)
message_text = message_text .. "Project Base" .. " = " .. macro_tag("$PB" )
-- Project file drive and directory (includes '\')
message_text = message_text .. "\nProject Drive Dir" .. " = " .. macro_tag("$PDD")
-- Project file extension (includes '.')
message_text = message_text .. "\nProject Ext" .. " = " .. macro_tag("$PE" )
-- Project file name
message_text = message_text .. "\nProject File" .. " = " .. macro_tag("$PF" )
-- name of all projects
all_projects = projects()
-- name of the active project
project_name = project_active()
-- files in the active project
files = project_files(project_name, 0, "\\n")
message_text = message_text .. "\n"
message_text = message_text .. "\nAll Project Names" .. " = " .. all_projects
message_text = message_text .. "\nActive Project Name" .. " = " .. project_name
message_text = message_text .. "\n\nActive Project Files:\n" .. files
else
message_text = "No workspace currently open!"
end
write(message_text)
end
key_macro() -- run the macro
Ok, I think I know what might be happening.
Over the years this project details macro tag has taken on different meanings.
For example in earlier versions of Zeus there was no concept of a workspace only a single project, so at that time this tag meant the details for that one and only project.
With the advent of the workspace containing multiple projects that had to change.
In the Zeus that I'm running (which is the latest version) this macro tag refers to the details found in the Workspace Options, in the General panel, in the Project Make File field.
So what I suggest doing is putting something into that field and seeing what happens when you run the macro.
Cheers Jussi
Over the years this project details macro tag has taken on different meanings.
For example in earlier versions of Zeus there was no concept of a workspace only a single project, so at that time this tag meant the details for that one and only project.
With the advent of the workspace containing multiple projects that had to change.
In the Zeus that I'm running (which is the latest version) this macro tag refers to the details found in the Workspace Options, in the General panel, in the Project Make File field.
So what I suggest doing is putting something into that field and seeing what happens when you run the macro.
Cheers Jussi