March 9, 20242 yr Good morning is it possible to read icao_airline charger or in the aircraft.cfg file of the livery THANKS
March 9, 20242 yr Commercial Member Check this list, section "ATC". These are all the variables that the simulator has to offer in that regardAircraft Radio Navigation Variables (flightsimulator.com) TMBK there is no variable that returns the ICAO code. (A:ATC AIRLINE, String) is the best you can hope for. Or try the callsign (A:ATC ID, String) LORBY-SI
March 10, 20242 yr Author THANKS (A:ATC ID, String) gives me the registration of the oat, it doesn't work I found a trick with the simbrief flight plan export in xml it's very useful if we have the possibility via AAO to read the airline icao code of the simbrief flight plan the goal of the exercise is to create a condition based on the icao airline code if icao_airline is ezy then run the script, which loads an image of the company
March 10, 20242 yr Commercial Member 12 minutes ago, ptimale said: THANKS (A:ATC ID, String) gives me the registration of the oat, it doesn't work I found a trick with the simbrief flight plan export in xml it's very useful if we have the possibility via AAO to read the airline icao code of the simbrief flight plan the goal of the exercise is to create a condition based on the icao airline code if icao_airline is ezy then run the script, which loads an image of the company You can query SimBrief from within AAO and get all the information in LVars. Enter your SimBrief credentials in the AAO "Extras" menu, then use the (LOAD_SIMBRIEF) or (LOAD_SIMBRIEF_PLAN) RPN commands. After the download has completed, you can find the LVars with "Scripts->Watch simulator variables->Select variable->Active local AAO variables" (they are all called (L:simbrief.*) The one you are looking for is probably "(L:simbrief.general.icao_airline, String)", obtained with (LOAD_SIMBRIEF) Edited March 10, 20242 yr by Lorby_SI LORBY-SI
March 10, 20242 yr Author (L:simbrief.general.icao_airline,·String) I have the icao airline code now I need to figure out how to rename a file in a folder based on the ivao_airline variable
March 10, 20242 yr Commercial Member 25 minutes ago, ptimale said: now I need to figure out how to rename a file in a folder based on the ivao_airline variable What for, what is the use case? AAO has commands for file operations (read, write, copy, move, delete). Check the AAO manual, chapter "Scripting", section about "File system operations". You can use them in RPN, JScript or VBScript. In JScript and VBScript you have additional options for file system access, but that requires a fair bit of research first (you have to utilize good old ActiveXObject class, Google will be your friend here) Random example for file access in JScript: var Fso = new ActiveXObject("Scripting.FileSystemObject"); var Log = Fso.OpenTextFile("LogFile.txt",2,true); //1 read, 2 write, 8 append Log.WriteLine("Something to log"); Log.close(); Edited March 10, 20242 yr by Lorby_SI LORBY-SI
March 10, 20242 yr Author I want to change the screen background of the Fenix EFB according to the icao_airline code The files are located in the folder: C:\ProgramData\Fenix\FenixSim A320\efb\img I just saw that when restarting the EFB it takes into account the change of the wallpaper
March 10, 20242 yr Commercial Member 2 minutes ago, ptimale said: I want to change the screen background of the Fenix EFB according to the icao_airline code The files are located in the folder: C:\ProgramData\Fenix\FenixSim A320\efb\img I just saw that when restarting the EFB it takes into account the change of the wallpaper I wouldn't rename files in that realm. Besides, you would probably have to force a refresh of the EFB html page anyway. LORBY-SI
March 10, 20242 yr Author this is a cache folder where the wallpaper is saved I'm not taking a big risk I have already made a powershell script that works via OFP simbrief, it's a bit crooked but it works 🙂 I would like to do it when loading the plane with AAO
March 10, 20242 yr Commercial Member 10 minutes ago, ptimale said: I would like to do it when loading the plane with AAO I don't see a problem with that? All the necessary elements are mentioned here in the thread. Create a script that queries simbrief, waits for a bit to make sure that the result is available, then evaluates that result and renames your target file. Implement it as an Aircraft Automated Script, One Shot, Beginning. Edited March 10, 20242 yr by Lorby_SI LORBY-SI
March 10, 20242 yr Author yes no problem for that for the moment I'm looking on Google how to rename the image in jscript and use the variable (L:simbrief.general.icao_airline,·String) I don't know the language 🙂
March 10, 20242 yr Commercial Member 18 minutes ago, ptimale said: yes no problem for that for the moment I'm looking on Google how to rename the image in jscript and use the variable (L:simbrief.general.icao_airline,·String) I don't know the language 🙂 Give me an example of what the files are called and I'll write an example for you. You don't have to use native JScript things, you can also call AAO commands from within JScript. Or use plain RPN like this. The file names you can build dynamically using the "scat" operator (LOAD_SIMBRIEF)·(SPLIT:2500)· 'SourceFile_'·(L:simbrief.general.icao_airline,·String)·scat·'.jpg'·scat·'TargetFile.jpg'·(COPYFILE:%s1|%s2) will for example query SimBrief, wait for 2,5 seconds, then copy "SourceFile_DLH.jpg" over "TargetFile.jpg". Edited March 10, 20242 yr by Lorby_SI LORBY-SI
March 10, 20242 yr Author le fichier est "C:\ProgramData\Fenix\FenixSim A320\efb\img\EWG.jpg" J'ai plusieurs fichiers d'arrière-plan dans ce dossier en fonction du code iCAO si la variable (L:simbrief.general.icao_airline,·String) est EWG alors renommez le fichier qui porte le titre ewg en Exif en bg.jpg Je peux vous envoyer mon script PowerShell pour comprendre le processus Edited March 10, 20242 yr by ptimale
March 10, 20242 yr Commercial Member (LOAD_SIMBRIEF)·(SPLIT:2500)· 'C:\ProgramData\Fenix\FenixSim A320\efb\img\'·(L:simbrief.general.icao_airline,·String)·scat·'.jpg'·scat·'C:\ProgramData\Fenix\FenixSim A320\efb\img\bg.jpg'·(COPYFILE:%s1|%s2) This is pure theory though. On my computer the \img\ folder doesn't exist, so I can't test it. Edited March 10, 20242 yr by Lorby_SI MOVEFILE was the wrong command! LORBY-SI
March 10, 20242 yr Author the script works but if I load "EWG" and then I load AFR it doesn't work because there is a bg.jpg file conflict script: Stage 1: rename the bg.jpg according to the title in title image tab Step 2: run your script Step 3: end of the script rename the bg.jpg with the variable (L:simbrief.general.icao_airline,·String) I'm looking but you go faster than me
Archived
This topic is now archived and is closed to further replies.